Skip to content

Commit

Permalink
More proxy functionality for external APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWatzinger committed Aug 13, 2024
1 parent 52b9c3b commit d096718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openatlas/api/external/geonames.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def fetch_geonames(id_: str) -> dict[str, Any]:
try:
data = requests.get(
app.config['API_GEONAMES'],
params,
params=params,
proxies=app.config['PROXIES'],
timeout=10).content
data_dict = xmltodict.parse(data)['geoname']
except Exception: # pragma: no cover
Expand Down
1 change: 1 addition & 0 deletions openatlas/api/external/wikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def fetch_wikidata(id_: str) -> dict[str, Any]:
data = requests.get(
app.config['API_WIKIDATA'],
params=params,
proxies=app.config['PROXIES'],
timeout=10).json()
except Exception: # pragma: no cover
return {}
Expand Down

0 comments on commit d096718

Please sign in to comment.