diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-25 01:10:30 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-25 01:10:30 +0800 |
commit | e367ea69e8e0bcbd570da1804ea20392f4ecd978 (patch) | |
tree | 327a83203ec359d7b7e4fb000baff5ccf47ec119 | |
parent | Cache-Control (diff) | |
download | powxy-e367ea69e8e0bcbd570da1804ea20392f4ecd978.tar.gz powxy-e367ea69e8e0bcbd570da1804ea20392f4ecd978.tar.zst powxy-e367ea69e8e0bcbd570da1804ea20392f4ecd978.zip |
Log form values on form validation attempts
-rw-r--r-- | handler.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) } |