mercurial/hgweb/hgweb_mod.py
changeset 36812 158d4ecc03c8
parent 36811 cfb9ef24968c
child 36814 f9078c6caeb6
equal deleted inserted replaced
36811:cfb9ef24968c 36812:158d4ecc03c8
   316             # replace it.
   316             # replace it.
   317             wsgireq.headers = [h for h in wsgireq.headers
   317             wsgireq.headers = [h for h in wsgireq.headers
   318                                if h[0] != 'Content-Security-Policy']
   318                                if h[0] != 'Content-Security-Policy']
   319             wsgireq.headers.append(('Content-Security-Policy', rctx.csp))
   319             wsgireq.headers.append(('Content-Security-Policy', rctx.csp))
   320 
   320 
       
   321         handled, res = wireprotoserver.handlewsgirequest(
       
   322             rctx, wsgireq, req, self.check_perm)
       
   323         if handled:
       
   324             return res
       
   325 
   321         if req.havepathinfo:
   326         if req.havepathinfo:
   322             query = req.dispatchpath
   327             query = req.dispatchpath
   323         else:
   328         else:
   324             query = req.querystring.partition('&')[0].partition(';')[0]
   329             query = req.querystring.partition('&')[0].partition(';')[0]
   325 
       
   326         # Route it to a wire protocol handler if it looks like a wire protocol
       
   327         # request.
       
   328         protohandler = wireprotoserver.parsehttprequest(rctx, wsgireq, req,
       
   329                                                         self.check_perm)
       
   330 
       
   331         if protohandler:
       
   332             try:
       
   333                 if query:
       
   334                     raise ErrorResponse(HTTP_NOT_FOUND)
       
   335 
       
   336                 return protohandler['dispatch']()
       
   337             except ErrorResponse as inst:
       
   338                 return protohandler['handleerror'](inst)
       
   339 
   330 
   340         # translate user-visible url structure to internal structure
   331         # translate user-visible url structure to internal structure
   341 
   332 
   342         args = query.split('/', 2)
   333         args = query.split('/', 2)
   343         if 'cmd' not in wsgireq.form and args and args[0]:
   334         if 'cmd' not in wsgireq.form and args and args[0]: