feat(backend): added extra logs
This commit is contained in:
parent
12e4a5b59c
commit
cb0743cc1e
1 changed files with 3 additions and 3 deletions
|
|
@ -29,9 +29,7 @@ func (e *Router) readBody(w http.ResponseWriter, r *http.Request, limit int64) (
|
|||
|
||||
// Check if body is gzipped and decompress it
|
||||
if r.Header.Get("Content-Encoding") == "gzip" {
|
||||
// Debug log
|
||||
log.Printf("request body is gzipped")
|
||||
//
|
||||
s := time.Now()
|
||||
reader, err := gzip.NewReader(body)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't create gzip reader: %s", err)
|
||||
|
|
@ -41,6 +39,8 @@ func (e *Router) readBody(w http.ResponseWriter, r *http.Request, limit int64) (
|
|||
return nil, fmt.Errorf("can't read gzip body: %s", err)
|
||||
}
|
||||
reader.Close()
|
||||
// Debug log
|
||||
log.Printf("request body was gzipped, decompressed in %s", time.Since(s))
|
||||
} else {
|
||||
bodyBytes, err = io.ReadAll(body)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue