Ticket #370 (closed defect: fixed)
Mime type parser fails on common application requests.
| Reported by: | GothAlice | Owned by: | ianb |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | paste | Version: | released-version |
| Severity: | normal | Keywords: | mime |
| Cc: |
Description
I receive things like the following exception report in my e-mail up to a dozen times a day. I'd like to allow spiders to spider my site without getting 500 errors on every request.
Module paste.util.mimeparse:35 in parse_mime_type
>> (type, subtype) = parts[0].split("/")
ValueError: need more than 1 value to unpack
With the following headers:
DOCUMENT_ROOT '/home/inlocation/app/site/src/location/public' DOCUMENT_URI '/' GATEWAY_INTERFACE 'CGI/1.1' HTTP_ACCEPT 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' HTTP_CACHE_CONTROL 'no-cache' HTTP_CONNECTION 'keep-alive' HTTP_HOST 'www.inlocation.ca' HTTP_PRAGMA 'no-cache' HTTP_USER_AGENT 'Java/1.6.0_05' PATH_INFO '/' REMOTE_ADDR '213.147.118.46' REMOTE_PORT '1954' REQUEST_METHOD 'GET' REQUEST_URI '/' SERVER_ADDR '10.249.74.112' SERVER_NAME 'www.inlocation.ca' SERVER_PORT '80' SERVER_PROTOCOL 'HTTP/1.1' SERVER_SOFTWARE 'nginx'
Note the malformed HTTP_ACCEPT. Invalid mime types should be silently removed from the stack, IMHO.
Change History
Note: See
TracTickets for help on using
tickets.
