From 68b71752a1a30de885700a1b3df8daab8523b05b Mon Sep 17 00:00:00 2001 From: Alistair Coles Date: Wed, 23 Aug 2023 11:44:53 +0100 Subject: [PATCH] s3api: use string for swift info request method A swift request was being constructed with its request method equal to the s3api's ListingEtagMiddleware. This was benign because the swift request is just used as a context to get container info, and its method is never used. However, it is better to use a dummy string value for the method. 'TEST' has been previously when an auth request is needed prior to getting container info, so the same is employed here. Change-Id: Ie1c70a0ada9883cc4c16b7fc8c2d91a50f4a91b7 --- swift/common/middleware/s3api/s3request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/common/middleware/s3api/s3request.py b/swift/common/middleware/s3api/s3request.py index afd66e3383..626377776f 100644 --- a/swift/common/middleware/s3api/s3request.py +++ b/swift/common/middleware/s3api/s3request.py @@ -1497,7 +1497,7 @@ class S3Request(swob.Request): _, self.account, _ = split_path(sw_resp.environ['PATH_INFO'], 2, 3, True) - sw_req = self.to_swift_req(app, self.container_name, None) + sw_req = self.to_swift_req('TEST', self.container_name, None) info = get_container_info(sw_req.environ, app, swift_source='S3') if is_success(info['status']): return info