diff --git a/test/functional/s3api/test_xxe_injection.py b/test/functional/s3api/test_xxe_injection.py index ae15e548c4..b046fed75c 100644 --- a/test/functional/s3api/test_xxe_injection.py +++ b/test/functional/s3api/test_xxe_injection.py @@ -14,17 +14,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -import base64 import requests import botocore -from swift.common.utils import md5 - import test.functional as tf from test.functional.s3api import S3ApiBaseBoto3 +def setUpModule(): + tf.setup_package() + + +def tearDownModule(): + tf.teardown_package() + + class TestS3ApiXxeInjection(S3ApiBaseBoto3): def setUp(self): @@ -144,11 +149,8 @@ class TestS3ApiXxeInjection(S3ApiBaseBoto3): """ body = body.encode('utf-8') - content_md5 = ( - base64.b64encode(md5(body, usedforsecurity=False).digest())) - resp = requests.post( - url, headers={'Content-MD5': content_md5}, data=body) - self.assertEqual(400, resp.status_code) + resp = requests.post(url, data=body) + self.assertEqual(400, resp.status_code, resp.content) self.assertNotIn(b'xxe', resp.content) self.assertNotIn(b'[swift-hash]', resp.content)