diff options
-rw-r--r-- | logger.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -24,6 +24,11 @@ func (rw *responseWriter) WriteHeader(code int) { rw.ResponseWriter.WriteHeader(code) } +const ( + kb = 1024 + mb = 1024 * kb +) + // Logger is a middleware for logging HTTP requests and responses, using go.eth.moe/logger. func Logger(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -47,6 +52,10 @@ func Logger(next http.Handler) http.Handler { } log.AddField(fmt.Sprintf("http.query.%s", k), vs) } + + if err := r.ParseMultipartForm(10 * mb); err != nil { + log.WithError(err).Error("could not parse request form") + } for k, vs := range r.Form { if len(vs) == 1 { log.AddField(fmt.Sprintf("http.form.%s", k), vs[0]) |