[#262] Fix status codes

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2021-09-21 12:31:23 +03:00 committed by Alex Vanin
parent 4991a22e3a
commit d616d9e2d9
5 changed files with 9 additions and 0 deletions

View file

@ -170,6 +170,7 @@ func (h *handler) PutBucketACLHandler(w http.ResponseWriter, r *http.Request) {
h.logAndSendError(w, "could not update bucket acl", reqInfo, err)
return
}
w.WriteHeader(http.StatusOK)
}
func (h *handler) updateBucketACL(r *http.Request, astChild *ast, bkt string) error {
@ -275,6 +276,7 @@ func (h *handler) PutObjectACLHandler(w http.ResponseWriter, r *http.Request) {
h.logAndSendError(w, "could not update bucket acl", reqInfo, err)
return
}
w.WriteHeader(http.StatusOK)
}
func (h *handler) GetBucketPolicyHandler(w http.ResponseWriter, r *http.Request) {
@ -331,6 +333,7 @@ func (h *handler) PutBucketPolicyHandler(w http.ResponseWriter, r *http.Request)
h.logAndSendError(w, "could not update bucket acl", reqInfo, err)
return
}
w.WriteHeader(http.StatusOK)
}
func parseACLHeaders(r *http.Request) (*AccessControlPolicy, error) {

View file

@ -196,4 +196,5 @@ func (h *handler) DeleteBucketHandler(w http.ResponseWriter, r *http.Request) {
if err := h.obj.DeleteBucket(r.Context(), &layer.DeleteBucketParams{Name: reqInfo.BucketName}); err != nil {
h.logAndSendError(w, "couldn't delete bucket", reqInfo, err)
}
w.WriteHeader(http.StatusNoContent)
}

View file

@ -131,6 +131,8 @@ func (h *handler) GetObjectHandler(w http.ResponseWriter, r *http.Request) {
writeHeaders(w.Header(), info, len(tagSet))
if params != nil {
writeRangeHeaders(w, params, info.Size)
} else {
w.WriteHeader(http.StatusOK)
}
getParams := &layer.GetObjectParams{

View file

@ -56,6 +56,7 @@ func (h *handler) PutObjectTaggingHandler(w http.ResponseWriter, r *http.Request
h.logAndSendError(w, "could not put object tagging", reqInfo, err)
return
}
w.WriteHeader(http.StatusOK)
}
func (h *handler) GetObjectTaggingHandler(w http.ResponseWriter, r *http.Request) {
@ -134,6 +135,7 @@ func (h *handler) PutBucketTaggingHandler(w http.ResponseWriter, r *http.Request
if err := h.obj.PutBucketTagging(r.Context(), reqInfo.BucketName, tagSet); err != nil {
h.logAndSendError(w, "could not put object tagging", reqInfo, err)
}
w.WriteHeader(http.StatusOK)
}
func (h *handler) GetBucketTaggingHandler(w http.ResponseWriter, r *http.Request) {

View file

@ -37,6 +37,7 @@ func (h *handler) PutBucketVersioningHandler(w http.ResponseWriter, r *http.Requ
if _, err := h.obj.PutBucketVersioning(r.Context(), p); err != nil {
h.logAndSendError(w, "couldn't put update versioning settings", reqInfo, err)
}
w.WriteHeader(http.StatusOK)
}
// GetBucketVersioningHandler implements bucket versioning getter handler.