##// END OF EJS Templates
hgweb: only recognize wire protocol commands from query string (BC)...
Gregory Szorc -
r36828:886fba19 default
parent child Browse files
Show More
@@ -330,7 +330,7 b' class hgweb(object):'
330
330
331 # Route it to a wire protocol handler if it looks like a wire protocol
331 # Route it to a wire protocol handler if it looks like a wire protocol
332 # request.
332 # request.
333 protohandler = wireprotoserver.parsehttprequest(rctx, wsgireq, query,
333 protohandler = wireprotoserver.parsehttprequest(rctx, wsgireq, req,
334 self.check_perm)
334 self.check_perm)
335
335
336 if protohandler:
336 if protohandler:
@@ -150,7 +150,7 b' class httpv1protocolhandler(wireprototyp'
150 def iscmd(cmd):
150 def iscmd(cmd):
151 return cmd in wireproto.commands
151 return cmd in wireproto.commands
152
152
153 def parsehttprequest(rctx, wsgireq, query, checkperm):
153 def parsehttprequest(rctx, wsgireq, req, checkperm):
154 """Parse the HTTP request for a wire protocol request.
154 """Parse the HTTP request for a wire protocol request.
155
155
156 If the current request appears to be a wire protocol request, this
156 If the current request appears to be a wire protocol request, this
@@ -159,16 +159,17 b' def parsehttprequest(rctx, wsgireq, quer'
159 request. Otherwise, ``None`` is returned.
159 request. Otherwise, ``None`` is returned.
160
160
161 ``wsgireq`` is a ``wsgirequest`` instance.
161 ``wsgireq`` is a ``wsgirequest`` instance.
162 ``req`` is a ``parsedrequest`` instance.
162 """
163 """
163 repo = rctx.repo
164 repo = rctx.repo
164
165
165 # HTTP version 1 wire protocol requests are denoted by a "cmd" query
166 # HTTP version 1 wire protocol requests are denoted by a "cmd" query
166 # string parameter. If it isn't present, this isn't a wire protocol
167 # string parameter. If it isn't present, this isn't a wire protocol
167 # request.
168 # request.
168 if 'cmd' not in wsgireq.form:
169 if 'cmd' not in req.querystringdict:
169 return None
170 return None
170
171
171 cmd = wsgireq.form['cmd'][0]
172 cmd = req.querystringdict['cmd'][0]
172
173
173 # The "cmd" request parameter is used by both the wire protocol and hgweb.
174 # The "cmd" request parameter is used by both the wire protocol and hgweb.
174 # While not all wire protocol commands are available for all transports,
175 # While not all wire protocol commands are available for all transports,
General Comments 0
You need to be logged in to leave comments. Login now