Ticket #370 (closed defect: fixed)

Opened 3 years ago

Last modified 18 months ago

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

Changed 20 months ago by nils

This should be the same as ticket #330.

Changed 18 months ago by chrisz

  • status changed from new to closed
  • resolution set to fixed

Yes, this is the same. Fixed first in  27140aab494b. Improved fix in  4145e60e4f40.

Note: See TracTickets for help on using tickets.