diff --git a/oioswift/common/middleware/slo.py b/oioswift/common/middleware/slo.py index 06acf3f..9464482 100644 --- a/oioswift/common/middleware/slo.py +++ b/oioswift/common/middleware/slo.py @@ -25,6 +25,7 @@ from hashlib import md5 import mimetypes import six +from six.moves.urllib.parse import urlencode import time from oio.common.json import json @@ -447,11 +448,14 @@ def resp_iter(total_size=total_size): last_yield_time = time.time() # BEGIN: New OpenIO code + params = { + 'format': 'json', + 'prefix': seg_prefix, + 'limit': self.max_manifest_segments + } sub_req = make_subrequest( req.environ, - path='%s?format=json&prefix=%s&limit=%d' % - (segments_container_path, seg_prefix, - self.max_manifest_segments), + path='%s?%s' % (segments_container_path, urlencode(params)), method='GET', headers={'x-auth-token': req.headers.get('x-auth-token')}, agent='%(orig)s SLO MultipartPUT', swift_source='SLO') diff --git a/tests/functional/s3-mpu.py b/tests/functional/s3-mpu.py index 18f5e9f..5b843f9 100755 --- a/tests/functional/s3-mpu.py +++ b/tests/functional/s3-mpu.py @@ -8,7 +8,7 @@ import json import os -ENDPOINT = os.getenv("USE_ENDPOINT", "http://127.0.0.1:5000") +ENDPOINT = os.getenv("USE_ENDPOINT", "http://localhost:5000") AWS = ["aws", "--endpoint", ENDPOINT] random_chars = string.lowercase + string.digits @@ -142,9 +142,19 @@ def run_test(bucket, path): def main(): run_test(random_str(10), - "docker/registry/v2/repositories/hello/_uploads/333633b0-503f-4b2a-9b43-e56ec6445ef3/data") # noqa + "docker/registry/v2/repositories/hello/_uploads/" + "333633b0-503f-4b2a-9b43-e56ec6445ef3/data") + run_test(random_str(10), + "docker/registry/v2/repositories/hello+world/_uploads/" + "333633b0-503f-4b2a-9b43-e56ec6445ef3/data") + run_test(random_str(10), + "docker/registry/v2/repositories/hello/_uploads/" + "333633b0-503f-4b2a-9b43-e56ec6445ef3/data+") run_test(random_str(10), "CBB_DESKTOP-1LC5CCV/C:/Bombay/Logs/titi:/12121212/titi") + run_test(random_str(10), + "CBB_DESKTOP-1LC5CCV/C:/Bombay/Logs/titi+rominet:/12121212/" + "titi+rominet") run_test(random_str(10), random_str(10))