Closed Bug 1023245 Opened 11 years ago Closed 9 years ago

non-utf8 user agent can cause internal server error on any page due

Categories

(Websites Graveyard :: mobilepartners.mozilla.org, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jgmize, Assigned: jgmize)

Details

Traceback (most recent call last): File "/home/fxoss/.virtualenvs/fxoss/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 136, in get_response response = middleware_method(request, response) File "/home/fxoss/.virtualenvs/fxoss/local/lib/python2.7/site-packages/mezzanine/core/middleware.py", line 101, in process_template_response response.template_name) File "/home/fxoss/.virtualenvs/fxoss/local/lib/python2.7/site-packages/mezzanine/utils/device.py", line 40, in templates_for_device device = device_from_request(request) File "/home/fxoss/.virtualenvs/fxoss/local/lib/python2.7/site-packages/mezzanine/utils/device.py", line 26, in device_from_request if ua_string.lower() in user_agent: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 52: ordinal not in range(128)
Assignee: nobody → jmize
We've upgraded mezzanine since this bug was filed, and the unicode handling has improved but there are still situations where we get unicode errors due to user agent decoding: Traceback (most recent call last): File "/home/fxoss/.virtualenvs/fxoss/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 136, in get_response response = middleware_method(request, response) File "/home/fxoss/.virtualenvs/fxoss/local/lib/python2.7/site-packages/mezzanine/core/middleware.py", line 115, in process_template_response response.template_name) File "/home/fxoss/.virtualenvs/fxoss/local/lib/python2.7/site-packages/mezzanine/utils/device.py", line 44, in templates_for_device device = device_from_request(request) File "/home/fxoss/.virtualenvs/fxoss/local/lib/python2.7/site-packages/mezzanine/utils/device.py", line 25, in device_from_request user_agent = user_agent.decode("utf-8") File "/home/fxoss/.virtualenvs/fxoss/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xd8 in position 44: invalid continuation byte
Summary: non-ascii characters in user agent causes internal server error on any page → non-utf8 user agent can cause internal server error on any page due
The website no longer exists, marking as WONTFIX. Thanks for reporting!
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.