S3 DeleteObjects - Allow multiple querystring formats
This commit is contained in:
parent
c39924501b
commit
49b00942c3
@ -137,8 +137,13 @@ def parse_key_name(pth):
|
|||||||
|
|
||||||
|
|
||||||
def is_delete_keys(request, path, bucket_name):
|
def is_delete_keys(request, path, bucket_name):
|
||||||
return path == "/?delete" or (
|
# GOlang sends a request as url/?delete= (treating it as a normal key=value, even if the value is empty)
|
||||||
path == "/" and getattr(request, "query_string", "") == "delete"
|
# Python sends a request as url/?delete (treating it as a flag)
|
||||||
|
# https://github.com/spulec/moto/issues/2937
|
||||||
|
return (
|
||||||
|
path == "/?delete"
|
||||||
|
or path == "/?delete="
|
||||||
|
or (path == "/" and getattr(request, "query_string", "") == "delete")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3765,7 +3765,7 @@ def test_paths_with_leading_slashes_work():
|
|||||||
|
|
||||||
@mock_s3
|
@mock_s3
|
||||||
def test_root_dir_with_empty_name_works():
|
def test_root_dir_with_empty_name_works():
|
||||||
if os.environ.get("TEST_SERVER_MODE", "false").lower() == "true":
|
if settings.TEST_SERVER_MODE:
|
||||||
raise SkipTest("Does not work in server mode due to error in Workzeug")
|
raise SkipTest("Does not work in server mode due to error in Workzeug")
|
||||||
store_and_read_back_a_key("/")
|
store_and_read_back_a_key("/")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user