mercurial/hgweb/hgweb_mod.py
changeset 35985 e69e65b2b4a9
parent 35984 cdc93fe1da77
child 35986 98a00aa0288d
equal deleted inserted replaced
35984:cdc93fe1da77 35985:e69e65b2b4a9
   366             try:
   366             try:
   367                 if query:
   367                 if query:
   368                     raise ErrorResponse(HTTP_NOT_FOUND)
   368                     raise ErrorResponse(HTTP_NOT_FOUND)
   369                 if cmd in perms:
   369                 if cmd in perms:
   370                     self.check_perm(rctx, req, perms[cmd])
   370                     self.check_perm(rctx, req, perms[cmd])
   371                 return protohandler['dispatch']()
       
   372             except ErrorResponse as inst:
   371             except ErrorResponse as inst:
   373                 # A client that sends unbundle without 100-continue will
   372                 # A client that sends unbundle without 100-continue will
   374                 # break if we respond early.
   373                 # break if we respond early.
   375                 if (cmd == 'unbundle' and
   374                 if (cmd == 'unbundle' and
   376                     (req.env.get('HTTP_EXPECT',
   375                     (req.env.get('HTTP_EXPECT',
   380                 else:
   379                 else:
   381                     req.headers.append((r'Connection', r'Close'))
   380                     req.headers.append((r'Connection', r'Close'))
   382                 req.respond(inst, wireprotoserver.HGTYPE,
   381                 req.respond(inst, wireprotoserver.HGTYPE,
   383                             body='0\n%s\n' % inst)
   382                             body='0\n%s\n' % inst)
   384                 return ''
   383                 return ''
       
   384 
       
   385             return protohandler['dispatch']()
   385 
   386 
   386         # translate user-visible url structure to internal structure
   387         # translate user-visible url structure to internal structure
   387 
   388 
   388         args = query.split('/', 2)
   389         args = query.split('/', 2)
   389         if r'cmd' not in req.form and args and args[0]:
   390         if r'cmd' not in req.form and args and args[0]: