comparison mercurial/hgweb/common.py @ 4038:5ae460b1f6f0

Don't use ints in HTTP headers
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 18 Jan 2007 22:16:26 -0200
parents abaee83ce0a6
children 12e4d9524951
comparison
equal deleted inserted replaced
4037:bbdba01cce28 4038:5ae460b1f6f0
36 path = os.path.join(path, part) 36 path = os.path.join(path, part)
37 try: 37 try:
38 os.stat(path) 38 os.stat(path)
39 ct = mimetypes.guess_type(path)[0] or "text/plain" 39 ct = mimetypes.guess_type(path)[0] or "text/plain"
40 req.header([('Content-type', ct), 40 req.header([('Content-type', ct),
41 ('Content-length', os.path.getsize(path))]) 41 ('Content-length', str(os.path.getsize(path)))])
42 return file(path, 'rb').read() 42 return file(path, 'rb').read()
43 except (TypeError, OSError): 43 except (TypeError, OSError):
44 # illegal fname or unreadable file 44 # illegal fname or unreadable file
45 return "" 45 return ""
46 46