(w http.ResponseWriter, r *http.Request)
| 24 | } |
| 25 | |
| 26 | func (q *ValidateQueryLogHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
| 27 | if err := validateQuery(r.URL.RawQuery); err != nil { |
| 28 | log.Infof("Invalid query: %s -> %s %s %s", r.RemoteAddr, r.Host, r.URL.Path, r.Method) |
| 29 | } |
| 30 | q.Handler.ServeHTTP(w, r) |
| 31 | } |
| 32 | |
| 33 | func validateQuery(s string) error { |
| 34 | _, err := url.ParseQuery(s) |