comparison mercurial/hgweb/request.py @ 5930:c301f15c965a

send conservatively capitalized HTTP headers
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 23 Jan 2008 14:28:25 +0100
parents b06c56f8fab7
children 948a41e77902
comparison
equal deleted inserted replaced
5929:e160f2312815 5930:c301f15c965a
78 return None 78 return None
79 79
80 def close(self): 80 def close(self):
81 return None 81 return None
82 82
83 def header(self, headers=[('Content-type','text/html')]): 83 def header(self, headers=[('Content-Type','text/html')]):
84 self.headers.extend(headers) 84 self.headers.extend(headers)
85 85
86 def httphdr(self, type, filename=None, length=0, headers={}): 86 def httphdr(self, type, filename=None, length=0, headers={}):
87 headers = headers.items() 87 headers = headers.items()
88 headers.append(('Content-type', type)) 88 headers.append(('Content-Type', type))
89 if filename: 89 if filename:
90 headers.append(('Content-disposition', 'inline; filename=%s' % 90 headers.append(('Content-Disposition', 'inline; filename=%s' %
91 filename)) 91 filename))
92 if length: 92 if length:
93 headers.append(('Content-length', str(length))) 93 headers.append(('Content-Length', str(length)))
94 self.header(headers) 94 self.header(headers)
95 95
96 def wsgiapplication(app_maker): 96 def wsgiapplication(app_maker):
97 '''For compatibility with old CGI scripts. A plain hgweb() or hgwebdir() 97 '''For compatibility with old CGI scripts. A plain hgweb() or hgwebdir()
98 can and should now be used as a WSGI application.''' 98 can and should now be used as a WSGI application.'''