From e367ea69e8e0bcbd570da1804ea20392f4ecd978 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 25 Mar 2025 01:10:30 +0800 Subject: Log form values on form validation attempts --- handler.go | 4 ++++ 1 file changed, 4 insertions(+) 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) } -- cgit v1.2.3