Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Overpass API requests to a specific IP address #699

Merged
merged 6 commits into from
May 9, 2021
Merged

Resolve Overpass API requests to a specific IP address #699

merged 6 commits into from
May 9, 2021

Conversation

gboeing
Copy link
Owner

@gboeing gboeing commented Apr 28, 2021

Fixes #698 when making Overpass requests by resolving a URL to its IP address then forcing socket.getaddrinfo to use that IP address instead of the host under the hood of the requests library. Works for http and https requests.

@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #699 (1fe0695) into main (47eda7d) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #699      +/-   ##
==========================================
- Coverage   97.09%   97.08%   -0.02%     
==========================================
  Files          24       24              
  Lines        2376     2399      +23     
==========================================
+ Hits         2307     2329      +22     
- Misses         69       70       +1     
Impacted Files Coverage Δ
osmnx/downloader.py 96.66% <100.00%> (-0.28%) ⬇️
osmnx/settings.py 100.00% <100.00%> (ø)
osmnx/_api.py 100.00% <0.00%> (ø)
osmnx/plot.py 96.69% <0.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47eda7d...1fe0695. Read the comment docs.

@gboeing gboeing merged commit 6407ad8 into main May 9, 2021
@gboeing gboeing deleted the ip branch May 9, 2021 04:23
@jslorrma
Copy link
Contributor

jslorrma commented Aug 30, 2021

Fixes #698 when making Overpass requests by resolving a URL to its IP address then forcing socket.getaddrinfo to use that IP address instead of the host under the hood of the requests library. Works for http and https requests.

This pull request breaks any download in case proxies are or have to be used, e.g. if one is using osmnx from within a corporate network. socket.gethostbyname can only resolve the URL's domain to an IP address for hosts within the corporate network. Trying to resolve an external URL raises the following error: gaierror: [Errno 11001] getaddrinfo failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overpass status endpoint provides incorrect results
2 participants