Skip to content
Snippets Groups Projects
Commit bf1eb78a authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Clean up some headers Tornado sets

parent 96961844
No related branches found
No related tags found
No related merge requests found
...@@ -159,12 +159,21 @@ class ProxyHandler(RequestHandler): ...@@ -159,12 +159,21 @@ class ProxyHandler(RequestHandler):
response = await self._get_with_cache(req_path) response = await self._get_with_cache(req_path)
# Forward the response to the client # Forward the response to the client ----------------
# 1. Status line
self.set_status(response.status, response.reason) self.set_status(response.status, response.reason)
# 2. Headers
# Clear default headers set by Tornado - values will come from upstream
self.clear_header('Server')
self.clear_header('Date')
self.clear_header('Content-Type')
for header, value in response.headers.get_all(): for header, value in response.headers.get_all():
self.add_header(header, value) self.add_header(header, value)
if response.body: self.add_header('Via', 'HTTP/1.1 CalParrot')
await self.finish(response.body)
# 3. Body
await self.finish(response.body)
class ShutdownHandler(RequestHandler): class ShutdownHandler(RequestHandler):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment