Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Sanitize the barcodes before making a query #891

Open
1 task
teolemon opened this issue Mar 11, 2021 · 0 comments
Open
1 task

Sanitize the barcodes before making a query #891

teolemon opened this issue Mar 11, 2021 · 0 comments
Labels

Comments

@teolemon
Copy link
Member

URL is not valid: https://ssl-api.openfoodfacts.org/api/v0/product/ 18 DEC 1988.json?fields=brands,code,ecoscore_alpha,ecoscore_grade,environment_impact_level_tags,image_front_url,image_front_small_url,image_small_url,image_url,nova_group,nutrition_grades,product_name,quantity,states

We could:

  • remove all whitespaces so that the URL is valid (it sends back the proper thing in a web browser: {"status":0,"code":"181988","status_verbose":"product not found"})

We should perhaps be cautious about directly enforcing anything like EAN-8 or EAN-13 (many cases where producers have longer barcodes like in spain)

@teolemon teolemon added the scan label Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant