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

Feature request: Allow overriding User-Agent header #128

Open
kerrickstaley opened this issue Jul 6, 2023 · 1 comment
Open

Feature request: Allow overriding User-Agent header #128

kerrickstaley opened this issue Jul 6, 2023 · 1 comment

Comments

@kerrickstaley
Copy link

Certain APIs will block access for clients without a browser-like user-agent. For example, the request

curl 'https://mybusnow.njtransit.com/bustime/eta/getStopPredictionsETA.jsp?stop=20509'

returns an HTML page with an error message. This error is also visible when you try to access the API through allorigins.win.

However, if you pass a browser-like user-agent, the request returns XML with bus departure times:

curl 'https://mybusnow.njtransit.com/bustime/eta/getStopPredictionsETA.jsp?stop=20509' \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0'

I think it'd be useful if allOrigins could take a &user_agent= parameter that overrides the user-agent in order to allow access to APIs like this.

@jo-chemla
Copy link

Would be great indeed! Could as well be extended to allow for custom request headers by passing a url-param headers={}&url=url json object which could include User-Agent, Authorization or anything like these.

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

No branches or pull requests

3 participants