openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
647 stars 374 forks source link

Wrong URL redirection #1219

Open Anubhav-Bhargava opened 6 years ago

Anubhav-Bhargava commented 6 years ago

Summary:

The URL redirects wrongly to another url barring access to ingredients list for France

Steps to reproduce:

Enter this URL:- http://fr.openfoodfacts.org/state/complete/ingredients.json It redirects to- https://fr.openfoodfacts.org/etat/complet.json

Expected behavior:

It should redirect to- http://fr.openfoodfacts.org/state/complete/ingredients.json

Observed behavior:

It redirects to- https://fr.openfoodfacts.org/etat/complet.json and thus we're unable to access ingredients data for France. Works fine for any other locale(eg:- world, uk, in etc)

aleksejrs commented 6 years ago

Seems like a different side of this bug happens at OpenProductsFacts:

Acceptable behavior:

The page at https://world-ru.openfoodfacts.org/ links to https://world-ru.openfoodfacts.org/state/to-be-completed which redirects to https://world-ru.openfoodfacts.org/%D1%81%D0%BE%D1%81%D1%82%D0%BE%D1%8F%D0%BD%D0%B8%D0%B5/%D0%BD%D0%B5-%D0%B7%D0%B0%D0%BF%D0%BE%D0%BB%D0%BD%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5 and works.

Observed behavior:

The page at https://world-ru.openproductsfacts.org/ links to https://world-ru.openproductsfacts.org/state/to-be-completed which does not redirect, and then does not work because the language is Russian, and there is a Russian translation for the URL. A similar thing happens at https://ru.openproductsfacts.org/