Make put-object-acl return 404 if the key does not exist (#3777)

Co-authored-by: Tibor Djurica Potpara <tibor.djurica@reddit.com>
This commit is contained in:
Tibor Djurica Potpara 2021-03-16 22:24:41 +00:00 committed by GitHub
commit b06e77b604
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -1305,8 +1305,11 @@ class ResponseObject(_TemplateEnvironmentMixin, ActionAuthenticatorMixin):
if "acl" in query:
key = self.backend.get_object(bucket_name, key_name)
# TODO: Support the XML-based ACL format
key.set_acl(acl)
return 200, response_headers, ""
if key is not None:
key.set_acl(acl)
return 200, response_headers, ""
else:
raise MissingKey(key_name)
if "tagging" in query:
if "versionId" in query: