diff options
-rw-r--r-- | docs/news.txt | 5 | ||||
-rwxr-xr-x | paste/httpserver.py | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/docs/news.txt b/docs/news.txt index f00e677..9353fe2 100644 --- a/docs/news.txt +++ b/docs/news.txt @@ -15,6 +15,11 @@ svn trunk it'll clear soon, and optionally killing the process when there are too many lost/zombie threads. +* Save host and scheme information during real HTTP proxy requests to + ``paste.httpserver``, into the keys + ``paste.httpserver.proxy.scheme`` and + ``paste.httpserver.proxy.host`` + * In ``paste.exceptions`` always call ``start_response``; may help problems when there is an exception in ``start_response`` itself. diff --git a/paste/httpserver.py b/paste/httpserver.py index 29c2065..d7dc190 100755 --- a/paste/httpserver.py +++ b/paste/httpserver.py @@ -176,7 +176,7 @@ class WSGIHandlerMixin: argument can be used to override any settings. """ - (_, _, path, query, fragment) = urlparse.urlsplit(self.path) + (scheme, netloc, path, query, fragment) = urlparse.urlsplit(self.path) path = urllib.unquote(path) endslash = path.endswith('/') path = posixpath.normpath(path) @@ -224,6 +224,10 @@ class WSGIHandlerMixin: # CGI not required by PEP-333 ,'REMOTE_ADDR': remote_address } + if scheme: + self.wsgi_environ['paste.httpserver.proxy.scheme'] = scheme + if netloc: + self.wsgi_environ['paste.httpserver.proxy.host'] = netloc if self.lookup_addresses: # @@: make lookup_addreses actually work, at this point |