Skip to content

Commit

Permalink
[gbfs] do not return default feeds on 401 and 429
Browse files Browse the repository at this point in the history
  • Loading branch information
eskerda committed Oct 13, 2023
1 parent 6eb2d74 commit cfd16e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pybikes/gbfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ def get_feeds(self, url, scraper, force_https):
return self.feeds

feed_data = scraper.request(url, raw=True)

# do not hide Unauthorized or Too many requests status codes
if scraper.last_request.status_code in [401, 429]:
raise Exception(feed_data)

if scraper.last_request.status_code >= 400:
# GBFS service description not found. Try to guess based on
# defaults
Expand Down

0 comments on commit cfd16e6

Please sign in to comment.