From 3524718a9ae4ab0e2c770351bf98d08ad6499156 Mon Sep 17 00:00:00 2001 From: David Goetz Date: Fri, 6 Apr 2012 13:51:11 -0700 Subject: [PATCH] wsgi pre_auth fixes Change-Id: Idb84bd6800c047ce1080039434b7957aa7d69b4d --- swift/common/wsgi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swift/common/wsgi.py b/swift/common/wsgi.py index 6df0b0dcfc..9b6c47c00e 100644 --- a/swift/common/wsgi.py +++ b/swift/common/wsgi.py @@ -298,7 +298,7 @@ def make_pre_authed_env(env, method=None, path=None, agent='Swift'): """ newenv = {} for name in ('eventlet.posthooks', 'HTTP_USER_AGENT', - 'PATH_INFO', 'REMOTE_USER', 'REQUEST_METHOD', + 'PATH_INFO', 'QUERY_STRING', 'REMOTE_USER', 'REQUEST_METHOD', 'SCRIPT_NAME', 'SERVER_NAME', 'SERVER_PORT', 'SERVER_PROTOCOL', 'swift.cache', 'swift.source', 'swift.trans_id'): @@ -307,6 +307,9 @@ def make_pre_authed_env(env, method=None, path=None, agent='Swift'): if method: newenv['REQUEST_METHOD'] = method if path: + if '?' in path: + path, query_string = path.split('?', 1) + newenv['QUERY_STRING'] = query_string newenv['PATH_INFO'] = path if agent: newenv['HTTP_USER_AGENT'] = (