aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-25 01:10:30 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-25 01:10:30 +0800
commite367ea69e8e0bcbd570da1804ea20392f4ecd978 (patch)
tree327a83203ec359d7b7e4fb000baff5ccf47ec119
parentCache-Control (diff)
downloadpowxy-e367ea69e8e0bcbd570da1804ea20392f4ecd978.tar.gz
powxy-e367ea69e8e0bcbd570da1804ea20392f4ecd978.tar.zst
powxy-e367ea69e8e0bcbd570da1804ea20392f4ecd978.zip
Log form values on form validation attempts
-rw-r--r--handler.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/handler.go b/handler.go
index 8f30c4c..85dbdc5 100644
--- a/handler.go
+++ b/handler.go
@@ -110,6 +110,7 @@ func handler(writer http.ResponseWriter, request *http.Request) {
"ip", remoteIP,
"uri", uri,
"user_agent", userAgent,
+ "form_values", formValues,
)
challengePage("You submitted an invalid number of form values.")
return
@@ -136,6 +137,7 @@ func handler(writer http.ResponseWriter, request *http.Request) {
"uri", uri,
"user_agent", userAgent,
"error", err,
+ "form_value", formValues[0],
)
challengePage("Your submission was improperly encoded.")
return
@@ -147,6 +149,7 @@ func handler(writer http.ResponseWriter, request *http.Request) {
"ip", remoteIP,
"uri", uri,
"user_agent", userAgent,
+ "form_value", formValues[0],
)
challengePage("Your submission was incorrect, or your session has expired while submitting.")
return
@@ -169,6 +172,7 @@ func handler(writer http.ResponseWriter, request *http.Request) {
"ip", remoteIP,
"uri", uri,
"user_agent", userAgent,
+ "form_value", formValues[0],
)
http.Redirect(writer, request, "", http.StatusSeeOther)
}