mercurial/hgweb/hgweb_mod.py
changeset 36871 9fc3d814646e
parent 36870 1f42d621f090
child 36872 89002d07a114
equal deleted inserted replaced
36870:1f42d621f090 36871:9fc3d814646e
   398 
   398 
   399             if cmd not in webcommands.__all__:
   399             if cmd not in webcommands.__all__:
   400                 msg = 'no such method: %s' % cmd
   400                 msg = 'no such method: %s' % cmd
   401                 raise ErrorResponse(HTTP_BAD_REQUEST, msg)
   401                 raise ErrorResponse(HTTP_BAD_REQUEST, msg)
   402             elif cmd == 'file' and req.qsparams.get('style') == 'raw':
   402             elif cmd == 'file' and req.qsparams.get('style') == 'raw':
   403                 rctx.ctype = ctype
   403                 res.status = '200 Script output follows'
       
   404                 res.headers['Content-Type'] = ctype
   404                 content = webcommands.rawfile(rctx, wsgireq, tmpl)
   405                 content = webcommands.rawfile(rctx, wsgireq, tmpl)
       
   406                 assert content is res
       
   407                 return res.sendresponse()
   405             else:
   408             else:
   406                 # Set some globals appropriate for web handlers. Commands can
   409                 # Set some globals appropriate for web handlers. Commands can
   407                 # override easily enough.
   410                 # override easily enough.
   408                 res.status = '200 Script output follows'
   411                 res.status = '200 Script output follows'
   409                 res.headers['Content-Type'] = ctype
   412                 res.headers['Content-Type'] = ctype