Skip to content

Commit

Permalink
hotfix for compression error
Browse files Browse the repository at this point in the history
  • Loading branch information
jmensch1 committed Sep 4, 2020
1 parent 8034c75 commit 37e2282
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/api/src/app.py
Expand Up @@ -69,6 +69,12 @@ def start():
async def on_restart(app, loop):
log_heading('restarting server')

# fixes error raised when compressing OPTIONS response
def fix_compression(req, res):
if req.method == 'OPTIONS':
res.content_type = ''
app.register_middleware(fix_compression, attach_to='response')

if Server.DEBUG:
add_performance_header(app)

Expand Down

0 comments on commit 37e2282

Please sign in to comment.