Colin Watson has proposed merging 
~cjwatson/launchpad:py3-basic-request-update-environ into launchpad:master.

Commit message:
BasicLaunchpadRequest: Update environ with decoded PATH_INFO

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/398013

Our countermeasures for Zope's sane_environment are a bit of a mess, but this 
ensures that other parts of Launchpad (e.g. AccessLoggingMiddleware) don't get 
confused by environ['PATH_INFO'] being bytes.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~cjwatson/launchpad:py3-basic-request-update-environ into launchpad:master.
diff --git a/lib/lp/services/webapp/servers.py b/lib/lp/services/webapp/servers.py
index 49ac4dd..0bd6152 100644
--- a/lib/lp/services/webapp/servers.py
+++ b/lib/lp/services/webapp/servers.py
@@ -593,6 +593,9 @@ class BasicLaunchpadRequest(LaunchpadBrowserRequestMixin):
             environ['PATH_INFO'] = pi.encode('utf-8')
         super(BasicLaunchpadRequest, self).__init__(
             body_instream, environ, response)
+        # Now replace PATH_INFO with the version decoded by sane_environment.
+        if 'PATH_INFO' in self._environ:
+            environ['PATH_INFO'] = self._environ['PATH_INFO']
 
         # Our response always vary based on authentication.
         self.response.setHeader('Vary', 'Cookie, Authorization')
_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to