Langue du navigateur non 'fr' / non 'en' : page d'erreur

bug relatif à #908 (closed)

pour reproduire (2 méthodes) :

  • modifier la langue par défaut du navigateur (par exemple en allemand) et ouvrir la page racine /, qui redirige vers /de/ (pour suivre notre exemple) ---> page 404 Not Found
  • utiliser CURL en indiquant l'entête HTTP Accept-Language :

Actuellement

redirection vers une URL qui n'existe pas.

curl -i -H "Accept-Language: fr" http://localhost:8282/
     HTTP/1.1 301 Moved Permanently
     Location: http://localhost:8282/fr/

curl -i -H "Accept-Language: ko" http://localhost:8282/
     HTTP/1.1 301 Moved Permanently
     Location: http://localhost:8282/ko/ ----> error 404

curl -i -H "Accept-Language: de" http://localhost:8282/
     HTTP/1.1 301 Moved Permanently
     Location: http://localhost:8282/de/ ----> error 404

Comportement attendu

redirection vers l'URL de la langue si elle existe, sinon rediriger vers la langue anglaise.

curl -i -H "Accept-Language: fr" http://localhost:8282/
     HTTP/1.1 301 Moved Permanently
     Location: http://localhost:8282/fr/

curl -i -H "Accept-Language: ko" http://localhost:8282/
     HTTP/1.1 301 Moved Permanently
     Location: http://localhost:8282/en/   

curl -i -H "Accept-Language: de" http://localhost:8282/
     HTTP/1.1 301 Moved Permanently
     Location: http://localhost:8282/en/   

bug complémentaire #913 (closed)

Edited by Fabrice Gangler