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

Document user-agent headers for browsers (Safari, Chrome, Mozilla) #5264

Open
Tracked by #5523
victorosorioparis opened this issue May 28, 2021 · 4 comments
Open
Tracked by #5523
Labels
🔐 API auth The API requires auth in order to perform editing.There is a common mechanism & a Robotoff mechanism API READ All READ APIs include Product, Search… API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.

Comments

@victorosorioparis
Copy link

victorosorioparis commented May 28, 2021

What

  • Currently it is not possible to set User-Agent headers in both Chrome and Safari, which are the most important browsers nowadays.

Your API documentation requires that this part of the request header is set with some user informations, I guess for statics purposes and to avoid abuse, warning that if not used the calls from the origin address will be blocked.

Since this is not possible, it would be a good idea to use another field or method from the request to put this information.

Sorry if there is another request like this, I could not found it.

Part of

@victorosorioparis victorosorioparis added the ✨ Feature Features or enhancements to Open Food Facts server label May 28, 2021
@stephanegigandet
Copy link
Contributor

One way could be to pass ?user_agent=your app in the URL.

@teolemon teolemon added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🔐 API auth The API requires auth in order to perform editing.There is a common mechanism & a Robotoff mechanism API READ All READ APIs include Product, Search… labels Jul 19, 2021
@ocervell
Copy link
Collaborator

Just tested a request on Chrome, it actually sets a user-agent:

user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36

Not sure about FF but it should be the same behavior.

@ocervell ocervell changed the title Another method to recognize valid API requests Document user-agent headers for browsers (Safari, Chrome, Mozilla) Aug 31, 2021
@eeschiavo
Copy link

I'm trying to scan some product and request info from your server adding user-agent as described in docs but this is not allowed, I got CORS errors:

Request header field User-Agent is not allowed by Access-Control-Allow-Headers.

Would be ok to pass this info in the URL as suggested before?

One way could be to pass ?user_agent=your app in the URL.

Thanks

Copy link
Contributor

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jan 29, 2024
@teolemon teolemon moved this to To discuss and validate in 🍊 Open Food Facts Server issues Apr 23, 2024
@teolemon teolemon removed the ✨ Feature Features or enhancements to Open Food Facts server label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔐 API auth The API requires auth in order to perform editing.There is a common mechanism & a Robotoff mechanism API READ All READ APIs include Product, Search… API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.
Projects
Status: To discuss and validate
Status: No status
Status: To be triaged
Development

No branches or pull requests

5 participants