Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions nbserverproxy/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ async def proxy(self, port, proxied_path):
# headers to see if and where they are being proxied from. We set
# them to be {base_url}/proxy/{port}.
headers['X-Forwarded-Context'] = headers['X-ProxyContextPath'] = \
url_path_join(self.base_url, 'proxy', port)
url_path_join(self.base_url, 'proxy', str(port))

req = httpclient.HTTPRequest(
client_uri, method=self.request.method, body=body,
Expand All @@ -262,7 +262,7 @@ async def proxy(self, port, proxied_path):

for header, v in response.headers.get_all():
if header not in ('Content-Length', 'Transfer-Encoding',
'Content-Encoding', 'Connection'):
'Content-Encoding', 'Connection'):
# some header appear multiple times, eg 'Set-Cookie'
self.add_header(header, v)

Expand Down Expand Up @@ -482,6 +482,7 @@ def patch(self, path):
def options(self, path):
return self.proxy(self.port, path)


def setup_handlers(web_app):
host_pattern = '.*$'
web_app.add_handlers('.*', [
Expand Down