Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 18348:764a758780b6
hgweb: simplify wsgirequest header handling
Remove leaky header abstraction and prepare for other encodings.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 15 Jan 2013 01:05:12 +0100 |
parents | 853221386f48 |
children | e33b9b92a200 |
comparison
equal
deleted
inserted
replaced
18347:853221386f48 | 18348:764a758780b6 |
---|---|
802 headers = [ | 802 headers = [ |
803 ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension)) | 803 ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension)) |
804 ] | 804 ] |
805 if encoding: | 805 if encoding: |
806 headers.append(('Content-Encoding', encoding)) | 806 headers.append(('Content-Encoding', encoding)) |
807 req.header(headers) | 807 req.headers.extend(headers) |
808 req.respond(HTTP_OK, mimetype) | 808 req.respond(HTTP_OK, mimetype) |
809 | 809 |
810 ctx = webutil.changectx(web.repo, req) | 810 ctx = webutil.changectx(web.repo, req) |
811 archival.archive(web.repo, req, cnode, artype, prefix=name, | 811 archival.archive(web.repo, req, cnode, artype, prefix=name, |
812 matchfn=scmutil.match(ctx, []), | 812 matchfn=scmutil.match(ctx, []), |