mirror of
https://github.com/minio/minio.git
synced 2026-11-22 15:13:48 +00:00
HEAD shouldn't have any body, handle it in writeErrorResponse()
This commit is contained in:
1 parent
7fde241ee2
commit
7615a6bfe5
5 files changed
+17
-35
No files matched your search
@@ -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