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

PATCH requests don't accept non-ASCII passwords #9503

Open
monsieurtanuki opened this issue Dec 10, 2023 · 1 comment
Open

PATCH requests don't accept non-ASCII passwords #9503

monsieurtanuki opened this issue Dec 10, 2023 · 1 comment
Labels
🔐 API auth The API requires auth in order to perform editing.There is a common mechanism & a Robotoff mechanism API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🔐 Password

Comments

@monsieurtanuki
Copy link
Contributor

I've changed my password in order to include a £ and have witnessed no problem in most cases:

  • changing basic details
  • uploading a new photo
  • cropping an existing photo
  • hunger games

BUT: I've encountered a problem with the new packagings feature, which is the only case to be saved with a PATCH request (temporarySaveProductV3, /api/v3/product/$barcode).

Any idea why the PATCH request would not accept a password with a £, whereas the /cgi/product_jqm2.pl POST works correctly?

patch param value
uri https://world.openfoodfacts.org/api/v3/product/9780000000001
header {Accept: application/json, User-Agent: - Smoothie - OpenFoodFacts - 0.0.0+734 - android+sdk_gphone64_x86_64-userdebug 12 SE1A.220203.002.A1 8151367 dev-keys - https://world.openfoodfacts.org/ - , From: monsieurtanuki}
body {"user_id":"monsieurtanuki","password":"something with a £","product":{"packagings":[{"shape":{"lc_name":"Bouteille"},"material":{"lc_name":"Verre"},"recycling":{"lc_name":"Recycler"},"number_of_units":1}]},"lc":"fr","tags_lc":"fr","cc":"fr","app_name":"Smoothie - OpenFoodFacts","app_version":"0.0.0+734","app_uuid":"6bd6aeef88464d03","app_platform":"android+sdk_gphone64_x86_64-userdebug 12 SE1A.220203.002.A1 8151367 dev-keys","comment":""}

Originally posted by @monsieurtanuki in openfoodfacts/smooth-app#4663 (comment)

@alexgarel
Copy link
Member

alexgarel commented Dec 18, 2023

@monsieurtanuki we have to give a look at how we parse the parameter.

We should also add an integration test for this !

@teolemon teolemon moved this to To discuss and validate in 🍊 Open Food Facts Server issues Apr 23, 2024
@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 labels Oct 11, 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 Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🔐 Password
Projects
Status: To discuss and validate
Development

No branches or pull requests

3 participants