Use toAPIErrorCode in HeadObject handler when decrypting request fails (#5600)

master
Anis Elleuch 7 years ago committed by Dee Koder
parent 4e5237b02a
commit 5f37988db5
  1. 2
      cmd/object-handlers.go

@ -253,7 +253,7 @@ func (api objectAPIHandlers) HeadObjectHandler(w http.ResponseWriter, r *http.Re
return
} else if encrypted {
if _, err = DecryptRequest(w, r, objInfo.UserDefined); err != nil {
writeErrorResponse(w, ErrSSEEncryptedObject, r.URL)
writeErrorResponse(w, toAPIErrorCode(err), r.URL)
return
}
w.Header().Set(SSECustomerAlgorithm, r.Header.Get(SSECustomerAlgorithm))

Loading…
Cancel
Save