mercurial/hgweb/request.py
changeset 2466 e10665147d26
parent 2464 09b1c9ef317c
child 2506 d0db3462d568
equal deleted inserted replaced
2465:c91118f425d0 2466:e10665147d26
    43     def header(self, headers=[('Content-type','text/html')]):
    43     def header(self, headers=[('Content-type','text/html')]):
    44         for header in headers:
    44         for header in headers:
    45             self.out.write("%s: %s\r\n" % header)
    45             self.out.write("%s: %s\r\n" % header)
    46         self.out.write("\r\n")
    46         self.out.write("\r\n")
    47 
    47 
    48     def httphdr(self, type, filename=None, length=0):
    48     def httphdr(self, type, filename=None, length=0, headers={}):
    49 
    49         headers = headers.items()
    50         headers = [('Content-type', type)]
    50         headers.append(('Content-type', type))
    51         if filename:
    51         if filename:
    52             headers.append(('Content-disposition', 'attachment; filename=%s' %
    52             headers.append(('Content-disposition', 'attachment; filename=%s' %
    53                             filename))
    53                             filename))
    54         # we do not yet support http 1.1 chunked transfer, so we have
    54         # we do not yet support http 1.1 chunked transfer, so we have
    55         # to force connection to close if content-length not known
    55         # to force connection to close if content-length not known