Skip to content

Commit

Permalink
fix 400 error on GET with content-type header
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpricethesecond committed Sep 16, 2024
1 parent 9d4f346 commit b3c6744
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions service/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,16 @@ def __init__(self, url_map, *items):

@app.before_request
def log_before():
logger.debug(f'========== Received new request:: {request} ==========')
if request.json:
logger.debug(f'json:: {request.json}')
logger.info(f'========== Received new request ==========')
logger.info({request})
# if request.json:
# logger.debug(f'json:: {request.json}')

@app.after_request
def log_after(response):
# logger.debug(f'request complete with status:: {response.data['status']}')

if response.status == '500 INTERNAL SERVER ERROR':
logger.error(f'\tEncountered error during request: {response.json}')
logger.debug(f'========== Ended request with status:: {response.status} ==========\n')
logger.info(f'========== Ended request with status:: {response.status} ==========\n')
return response

0 comments on commit b3c6744

Please sign in to comment.