wsgi pre_auth fixes

Change-Id: Idb84bd6800c047ce1080039434b7957aa7d69b4d
This commit is contained in:
David Goetz 2012-04-06 13:51:11 -07:00
parent f26d2e5f99
commit 3524718a9a

View File

@ -298,7 +298,7 @@ def make_pre_authed_env(env, method=None, path=None, agent='Swift'):
""" """
newenv = {} newenv = {}
for name in ('eventlet.posthooks', 'HTTP_USER_AGENT', 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', 'SCRIPT_NAME', 'SERVER_NAME', 'SERVER_PORT',
'SERVER_PROTOCOL', 'swift.cache', 'swift.source', 'SERVER_PROTOCOL', 'swift.cache', 'swift.source',
'swift.trans_id'): 'swift.trans_id'):
@ -307,6 +307,9 @@ def make_pre_authed_env(env, method=None, path=None, agent='Swift'):
if method: if method:
newenv['REQUEST_METHOD'] = method newenv['REQUEST_METHOD'] = method
if path: if path:
if '?' in path:
path, query_string = path.split('?', 1)
newenv['QUERY_STRING'] = query_string
newenv['PATH_INFO'] = path newenv['PATH_INFO'] = path
if agent: if agent:
newenv['HTTP_USER_AGENT'] = ( newenv['HTTP_USER_AGENT'] = (