mercurial/hgweb/hgweb_mod.py
changeset 36871 9fc3d814646e
parent 36870 1f42d621f090
child 36872 89002d07a114
--- a/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 17:02:57 2018 -0800
+++ b/mercurial/hgweb/hgweb_mod.py	Sat Mar 10 20:36:34 2018 -0800
@@ -400,8 +400,11 @@
                 msg = 'no such method: %s' % cmd
                 raise ErrorResponse(HTTP_BAD_REQUEST, msg)
             elif cmd == 'file' and req.qsparams.get('style') == 'raw':
-                rctx.ctype = ctype
+                res.status = '200 Script output follows'
+                res.headers['Content-Type'] = ctype
                 content = webcommands.rawfile(rctx, wsgireq, tmpl)
+                assert content is res
+                return res.sendresponse()
             else:
                 # Set some globals appropriate for web handlers. Commands can
                 # override easily enough.