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
8 changes: 7 additions & 1 deletion nbserverproxy/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ async def proxy(self, port, proxied_path):

req = httpclient.HTTPRequest(
client_uri, method=self.request.method, body=body,
headers=self.request.headers, follow_redirects=False)
headers=self.request.headers,
**self.proxy_request_options())

response = await client.fetch(req, raise_error=False)
# record activity at start and end of requests
Expand All @@ -260,6 +261,11 @@ async def proxy(self, port, proxied_path):
if response.body:
self.write(response.body)

def proxy_request_options(self):
'''A dictionary of options to be used when constructing
a tornado.httpclient.HTTPRequest instance for the proxy request.'''
return dict(follow_redirects=False)

# Support all the methods that torando does by default except for GET which
# is passed to WebSocketHandlerMixin and then to WebSocketHandler.

Expand Down