Skip to content

Commit

Permalink
Due with heroku proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloEmidio committed Jan 17, 2022
1 parent f09ce06 commit 99d33cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mldictionary_api/routes/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def dictionary(word: str):

choice = request.url.split('/')[5]
dictionary = DICTIONARIES[choice]
request_ip = request.remote_addr
request_ip = request.remote_addr if not request.headers.getlist("X-Forwarded-For") else request.headers.getlist("X-Forwarded-For")[0]
total_requests = requests_db.get(f'requests:{request_ip}')
if not (meanings := dictionary.get_meanings(word)):
raise NotFound(f'"{word}" not found, check the spelling and try again')
Expand Down

0 comments on commit 99d33cc

Please sign in to comment.