Skip to content

Commit

Permalink
Capitalize the token header title
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustinefe committed Apr 17, 2024
1 parent 7e07563 commit c18c62f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/apps/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def _get_token(headers: dict):

def process_header(headers, body: dict) -> (dict, bool):
token = _get_token(headers)
logging.info(f"TOKEN | {token}")
if not token and not (body and "user_id" in body):
return body, False
newBody = body.copy() if body else {}
Expand Down Expand Up @@ -76,10 +77,11 @@ def post(self, url, body, headers, query_params):
logging.info(f"USERS | POST | {url}")
logging.debug(f"BODY: {body}")
headers = dict(response.headers)
logging.info(f"TOKEN | {headers}")
response = make_response(self.getResponseJson(response),
response.status_code)
if headers.get(TOKEN_FIELD_NAME):
response.headers[TOKEN_FIELD_NAME] = headers.get(TOKEN_FIELD_NAME)
if headers.get(TOKEN_FIELD_NAME.title()):
response.headers[TOKEN_FIELD_NAME] = headers.get(TOKEN_FIELD_NAME.title())
return response

def patch(self, url, body, headers, query_params):
Expand Down

0 comments on commit c18c62f

Please sign in to comment.