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

This commit is contained in:
Anis Elleuch 2018-03-02 01:01:56 +01:00 committed by Dee Koder
parent 4e5237b02a
commit 5f37988db5
1 changed files with 1 additions and 1 deletions

View File

@ -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))