mirror of
https://github.com/minio/minio.git
synced 2025-11-21 18:26:04 -05:00
HEAD shouldn't have any body, handle it in writeErrorResponse()
This commit is contained in:
@@ -201,6 +201,9 @@ func writeErrorResponse(w http.ResponseWriter, req *http.Request, errorType int,
|
||||
setCommonHeaders(w, getContentTypeString(acceptsContentType), len(encodedErrorResponse))
|
||||
// write Header
|
||||
w.WriteHeader(error.HTTPStatusCode)
|
||||
// write error body
|
||||
w.Write(encodedErrorResponse)
|
||||
// HEAD should have no body
|
||||
if req.Method != "HEAD" {
|
||||
// write error body
|
||||
w.Write(encodedErrorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user