Skip to content

Commit

Permalink
Fixed patchObject ignoring ContentType and ContentEncoding
Browse files Browse the repository at this point in the history
  • Loading branch information
UnAfraid committed Dec 15, 2023
1 parent 445e8cf commit 4633abc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fakestorage/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -1010,9 +1010,11 @@ func (s *Server) patchObject(r *http.Request) jsonResponse {
}

var payload struct {
Metadata map[string]string `json:"metadata"`
CustomTime string
Acl []acls
ContentType string
ContentEncoding string
Metadata map[string]string `json:"metadata"`
CustomTime string
Acl []acls
}
err := json.NewDecoder(r.Body).Decode(&payload)
if err != nil {
Expand All @@ -1024,6 +1026,8 @@ func (s *Server) patchObject(r *http.Request) jsonResponse {

var attrsToUpdate backend.ObjectAttrs

attrsToUpdate.ContentType = payload.ContentType
attrsToUpdate.ContentEncoding = payload.ContentEncoding
attrsToUpdate.Metadata = payload.Metadata
attrsToUpdate.CustomTime = payload.CustomTime

Expand Down

0 comments on commit 4633abc

Please sign in to comment.