Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

http://www.openstreetmap.org/ completely fails on legal Accept-Language header #2318

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 1 comment

Comments

@openstreetmap-trac
Copy link

Reporter: ndim
[Submitted to the original trac issue database at 12.04pm, Saturday, 26th September 2009]

When given a HTTP request with an HTTP header like

Accept-Language: en-us,en;q=0.9,de-de;q=0.8,de;q=0.7,fr-fr;q=0.6,fr;q=0.4,es-es;q=0.3,es;q=0.2,*;q=0.1

the server behind http://www.openstreetmap.org/ just replies with a HTTP 500 error.

Above Accept-Language header is legal according to definitions of RFC2616, as I read it:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4

The following header does not trigger the issue:

Accept-Language: en-us,en;q=0.9,de-de;q=0.8,de;q=0.7,fr-fr;q=0.6,fr;q=0.4,es-es;q=0.3,es;q=0.2

You can test different Accept-Language headers e.g. by using Firefox: Enter "about:config", and change the setting for "intl.accept_language" from something like "en-us, en, de-de, de, fr-fr, fr, es-es, es" to "en-us, en, de-de, de, fr-fr, fr, es-es, es, *".

@openstreetmap-trac
Copy link
Author

Author: tomhughes
[Added to the original trac issue at 10.39pm, Saturday, 26th September 2009]

(In [17811]) Escape language codes before matching them in case they contain
characters with special meaning in a regexp. Closes #2318.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant