S3: Accept-Ranges headers should have dash (#6326)

This commit is contained in:
Bert Blommers 2023-05-15 22:45:34 +00:00 committed by GitHub
parent 054ebcb326
commit 73257241ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1393,7 +1393,7 @@ class S3Response(BaseResponse):
response_headers.update(key.metadata)
response_headers.update(key.response_dict)
response_headers.update({"AcceptRanges": "bytes"})
response_headers.update({"Accept-Ranges": "bytes"})
return 200, response_headers, key.value
def _key_response_put(
@ -1698,7 +1698,7 @@ class S3Response(BaseResponse):
if key:
response_headers.update(key.metadata)
response_headers.update(key.response_dict)
response_headers.update({"AcceptRanges": "bytes"})
response_headers.update({"Accept-Ranges": "bytes"})
if if_unmodified_since:
if_unmodified_since = str_to_rfc_1123_datetime(if_unmodified_since)

View File

@ -75,13 +75,13 @@ def test_s3_server_bucket_create(key_name):
# HeadObject
res = test_client.head(f"/{key_name}", "http://foobaz.localhost:5000/")
res.status_code.should.equal(200)
assert res.headers.get("AcceptRanges") == "bytes"
assert res.headers.get("Accept-Ranges") == "bytes"
# GetObject
res = test_client.get(f"/{key_name}", "http://foobaz.localhost:5000/")
res.status_code.should.equal(200)
res.data.should.equal(b"test value")
assert res.headers.get("AcceptRanges") == "bytes"
assert res.headers.get("Accept-Ranges") == "bytes"
def test_s3_server_ignore_subdomain_for_bucketnames():