comparison mercurial/byterange.py @ 5930:c301f15c965a

send conservatively capitalized HTTP headers
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 23 Jan 2008 14:28:25 +0100
parents eb0b4a2d70a9
children 8fee8ff13d37
comparison
equal deleted inserted replaced
5929:e160f2312815 5930:c301f15c965a
231 if fb < 0 or fb > size or lb > size: 231 if fb < 0 or fb > size or lb > size:
232 raise RangeError('Requested Range Not Satisfiable') 232 raise RangeError('Requested Range Not Satisfiable')
233 size = (lb - fb) 233 size = (lb - fb)
234 fo = RangeableFileObject(fo, (fb, lb)) 234 fo = RangeableFileObject(fo, (fb, lb))
235 headers = mimetools.Message(StringIO( 235 headers = mimetools.Message(StringIO(
236 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % 236 'Content-Type: %s\nContent-Length: %d\nLast-Modified: %s\n' %
237 (mtype or 'text/plain', size, modified))) 237 (mtype or 'text/plain', size, modified)))
238 return urllib.addinfourl(fo, headers, 'file:'+file) 238 return urllib.addinfourl(fo, headers, 'file:'+file)
239 239
240 240
241 # FTP Range Support 241 # FTP Range Support