Merge "eventlet.posthook related code needn't anymore"

This commit is contained in:
Jenkins
2015-09-02 08:13:08 +00:00
committed by Gerrit Code Review
2 changed files with 9 additions and 2 deletions

View File

@@ -1084,8 +1084,8 @@ def make_env(env, method=None, path=None, agent='Swift', query_string=None,
:returns: Fresh WSGI environment.
"""
newenv = {}
for name in ('eventlet.posthooks', 'HTTP_USER_AGENT', 'HTTP_HOST',
'PATH_INFO', 'QUERY_STRING', 'REMOTE_USER', 'REQUEST_METHOD',
for name in ('HTTP_USER_AGENT', 'HTTP_HOST', 'PATH_INFO',
'QUERY_STRING', 'REMOTE_USER', 'REQUEST_METHOD',
'SCRIPT_NAME', 'SERVER_NAME', 'SERVER_PORT',
'HTTP_ORIGIN', 'HTTP_ACCESS_CONTROL_REQUEST_METHOD',
'SERVER_PROTOCOL', 'swift.cache', 'swift.source',

View File

@@ -818,6 +818,13 @@ class BaseObjectController(Controller):
self.object_name = dest_object
# re-write the existing request as a PUT instead of creating a new one
# since this one is already attached to the posthooklogger
# TODO: Swift now has proxy-logging middleware instead of
# posthooklogger used in before. i.e. we don't have to
# keep the code depends on evnetlet.posthooks sequence, IMHO.
# However, creating a new sub request might
# cause the possibility to hide some bugs behindes the request
# so that we should discuss whichi is suitable (new-sub-request
# vs re-write-existing-request) for Swift. [kota_]
req.method = 'PUT'
req.path_info = '/v1/%s/%s/%s' % \
(dest_account, dest_container, dest_object)