Skip to content

Commit

Permalink
clear previous headers
Browse files Browse the repository at this point in the history
  • Loading branch information
nggit committed Nov 25, 2023
1 parent a6ac837 commit 4417c80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tremolo/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ async def _handle_middleware(self, func, options={}):
'possibly left open', func.__name__)
return

self.response.headers.clear()

if 'status' in options:
self.response.set_status(*options['status'])

Expand Down
1 change: 1 addition & 0 deletions tremolo/lib/http_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ async def handle_exception(self, exc):
exc = InternalServerError(cause=exc)

if self.request is not None and self.response is not None:
self.response.headers.clear()
self.response.set_status(exc.code, exc.message)
self.response.set_content_type(exc.content_type)
data = b''
Expand Down

0 comments on commit 4417c80

Please sign in to comment.