diff mercurial/hgweb/webcommands.py @ 18347:853221386f48

hgweb: make type a mandatory parameter to request.respond There will thus always be headers and the runtime check can be removed.
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 15 Jan 2013 01:05:12 +0100
parents e350ce798b63
children 764a758780b6
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Tue Jan 15 01:05:12 2013 +0100
+++ b/mercurial/hgweb/webcommands.py	Tue Jan 15 01:05:12 2013 +0100
@@ -800,13 +800,12 @@
     name = "%s-%s" % (reponame, arch_version)
     mimetype, artype, extension, encoding = web.archive_specs[type_]
     headers = [
-        ('Content-Type', mimetype),
         ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension))
-    ]
+        ]
     if encoding:
         headers.append(('Content-Encoding', encoding))
     req.header(headers)
-    req.respond(HTTP_OK)
+    req.respond(HTTP_OK, mimetype)
 
     ctx = webutil.changectx(web.repo, req)
     archival.archive(web.repo, req, cnode, artype, prefix=name,