From 8ab06eb8cc08a6f5905efde5b07cee3e71805a77 Mon Sep 17 00:00:00 2001 From: anc Date: Fri, 27 Sep 2013 10:10:55 +0100 Subject: [PATCH] Set path_info in sub_slo manifest GET requests The new_req Request object created for fetching nested sub_slo manifests does not have its path_info set to the sub_slo path before being passed to GETorHEAD_base. The sub manifest GET works fine because GETorHEAD_base uses its path argument (not req.path) to set up its connection, BUT if an exception is thrown, GETorHEAD_base uses req.path to construct the log message - so the exception log would have the wrong path. Fixes bug 1231872 Change-Id: I0f0f969958f814d8a7053440d9de4e50796169e4 --- swift/proxy/controllers/obj.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py index 7fc6d87a80..b8a36dedcf 100644 --- a/swift/proxy/controllers/obj.py +++ b/swift/proxy/controllers/obj.py @@ -417,6 +417,7 @@ class ObjectController(Controller): new_req = incoming_req.copy_get() new_req.method = 'GET' new_req.range = None + new_req.path_info = '/'.join(['', account, container, obj]) if partition is None: try: partition = self.app.object_ring.get_part( @@ -427,7 +428,7 @@ class ObjectController(Controller): new_req.path) valid_resp = self.GETorHEAD_base( new_req, _('Object'), self.app.object_ring, partition, - '/'.join(['', account, container, obj])) + new_req.path_info) if 'swift.authorize' in incoming_req.environ: incoming_req.acl = valid_resp.headers.get('x-container-read')