mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Send Content-Length in the response headers (#7771)
curl using http1.0 would hang sometimes when Content-Length is missing in response headers fixes #7661
This commit is contained in:
parent
1039311184
commit
0394a8f013
@ -22,6 +22,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -523,6 +524,7 @@ func writeResponse(w http.ResponseWriter, statusCode int, response []byte, mType
|
|||||||
if mType != mimeNone {
|
if mType != mimeNone {
|
||||||
w.Header().Set("Content-Type", string(mType))
|
w.Header().Set("Content-Type", string(mType))
|
||||||
}
|
}
|
||||||
|
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
|
||||||
w.WriteHeader(statusCode)
|
w.WriteHeader(statusCode)
|
||||||
if response != nil {
|
if response != nil {
|
||||||
w.Write(response)
|
w.Write(response)
|
||||||
|
Loading…
Reference in New Issue
Block a user