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
This commit is contained in:
Alistair Coles 2023-08-23 11:44:53 +01:00
parent db5c3aeb56
commit 68b71752a1

View File

@ -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