mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
trace: Print either Transfer-Encoding or Content-Length (#8314)
If Transfer-Encoding is set client would have never set Content-Length as its considered malformed HTTP request
This commit is contained in:
parent
f3022e891d
commit
4155f4e49b
@ -100,8 +100,10 @@ func Trace(f http.HandlerFunc, logBody bool, w http.ResponseWriter, r *http.Requ
|
||||
|
||||
// Setup a http request body recorder
|
||||
reqHeaders := r.Header.Clone()
|
||||
reqHeaders.Set("Content-Length", strconv.Itoa(int(r.ContentLength)))
|
||||
reqHeaders.Set("Host", r.Host)
|
||||
if len(r.TransferEncoding) == 0 {
|
||||
reqHeaders.Set("Content-Length", strconv.Itoa(int(r.ContentLength)))
|
||||
}
|
||||
for _, enc := range r.TransferEncoding {
|
||||
reqHeaders.Add("Transfer-Encoding", enc)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user