After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671652 - HTTP_ENVIRON locale contains whitespace
HTTP_ENVIRON locale contains whitespace
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: [obsolete] Backend:Base
3.0.x (obsolete)
Other Linux
: Normal minor
: ---
Assigned To: Xan Lopez
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-08 15:05 UTC by boekeltjuh
Modified: 2013-01-04 20:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
e-embed-prefs: remove spaces in Accept-Language (1023 bytes, patch)
2012-12-14 13:35 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review

Description boekeltjuh 2012-03-08 15:05:12 UTC
Epiphany causes errors when visiting websites (such as http://main.g2.bx.psu.edu/ ) that parse locale settings such as 'en-us' via e.g. Babel (http://babel.edgewall.org/). 

It appears that sometimes ' en-us' is passed (including a prefix-whitespace). I'm running epiphany 3.0.4 on Ubuntu 11.10. A Babel-running site's specific debug message can be found below:

File '[cut]/galaxy-central/eggs/Babel-0.9.4-py2.7.egg/babel/core.py', line 212 in parse
  return cls(*parse_locale(identifier, sep=sep))
File '[cut]/galaxy-central/eggs/Babel-0.9.4-py2.7.egg/babel/core.py', line 763 in parse_locale
  raise ValueError('expected only letters, got %r' % lang)
ValueError: expected only letters, got ' en'
Comment 1 Xan Lopez 2012-03-09 13:43:54 UTC
I guess we need to normalize the string we get.
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2012-12-14 13:24:41 UTC
Well apparently we are doing the right thing:

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

Epiphany sends:
  Accept-Language: en-gb, es-pe;q=0.90, en;q=0.80, es;q=0.70

Iceweasel and Chrome present themselves like this:
  Accept-Language: en-us,es-es;q=0.8,es;q=0.5,en;q=0.3
  Accept-Language: en,es-419;q=0.8,es;q=0.6

Probably because this problem is not exclusive to Babel.

Obviously the code in Babel is doing a string.split(",") and using the value without sanitizing:

  http://lists.bx.psu.edu/pipermail/galaxy-dev/2012-March/008885.html

The problem, thus, is on both sides:
  · Babel should sanitize its strings, they can't cheerfully expect sane input from users.
  · Even if it does not follow the RFC, Epiphany should do what the other browsers do.
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2012-12-14 13:35:19 UTC
Created attachment 231571 [details] [review]
e-embed-prefs: remove spaces in Accept-Language

Some servers, like Babel, do not correctly sanitize the string in this
header. They expect strings without spaces, even though the RFC includes
them.

Chrome and Firefox do not use spaces, presumably because many more
websites break when using them.
Comment 4 Xan Lopez 2013-01-03 16:19:56 UTC
Review of attachment 231571 [details] [review]:

OK, if Chrome and Firefox do this let's go ahead.
Comment 5 Diego Escalante Urrelo (not reading bugmail) 2013-01-04 20:46:40 UTC
Attachment 231571 [details] pushed as 7e764ea - e-embed-prefs: remove spaces in Accept-Language