Ticket #341: paste.patch
| File paste.patch, 1.2 KB (added by chrisz, 3 years ago) |
|---|
-
paste/httpheaders.py
136 136 """ 137 137 import urllib2 138 138 import re 139 from mimetypes import guess_type 139 import mimetypes 140 140 from rfc822 import formatdate, parsedate_tz, mktime_tz 141 141 from time import time as now 142 142 from httpexceptions import HTTPBadRequest … … 575 575 (key, val) = response_headers[idx] 576 576 head = get_header(key, strict) 577 577 if not head: 578 newhead = '-'.join([x.capitalize() for x in 578 newhead = '-'.join([x.capitalize() for x in 579 579 key.replace("_","-").split("-")]) 580 580 response_headers[idx] = (newhead, val) 581 581 category[newhead] = 4 … … 855 855 (result, filename) = self._compose(**kwargs) 856 856 mimetype = CONTENT_TYPE(collection) 857 857 if filename and (not mimetype or CONTENT_TYPE.UNKNOWN == mimetype): 858 mimetype, _ = guess_type(filename)858 mimetype, _ = mimetypes.guess_type(filename) 859 859 if mimetype and CONTENT_TYPE.UNKNOWN != mimetype: 860 860 CONTENT_TYPE.update(collection, mimetype) 861 861 self.update(collection, *result)
