comparison mercurial/wireprotoserver.py @ 36713:2442927cdd96

hgweb: convert req.form to bytes for all keys and values This is just going to be a lot cleaner for our internals. Differential Revision: https://phab.mercurial-scm.org/D2660
author Augie Fackler <augie@google.com>
date Sun, 04 Mar 2018 13:03:22 -0500
parents 6e585bca962e
children 7bf80d9d9543
comparison
equal deleted inserted replaced
36712:e79adc12cde3 36713:2442927cdd96
157 ``req`` is a ``wsgirequest`` instance. 157 ``req`` is a ``wsgirequest`` instance.
158 """ 158 """
159 # HTTP version 1 wire protocol requests are denoted by a "cmd" query 159 # HTTP version 1 wire protocol requests are denoted by a "cmd" query
160 # string parameter. If it isn't present, this isn't a wire protocol 160 # string parameter. If it isn't present, this isn't a wire protocol
161 # request. 161 # request.
162 if r'cmd' not in req.form: 162 if 'cmd' not in req.form:
163 return None 163 return None
164 164
165 cmd = pycompat.sysbytes(req.form[r'cmd'][0]) 165 cmd = req.form['cmd'][0]
166 166
167 # The "cmd" request parameter is used by both the wire protocol and hgweb. 167 # The "cmd" request parameter is used by both the wire protocol and hgweb.
168 # While not all wire protocol commands are available for all transports, 168 # While not all wire protocol commands are available for all transports,
169 # if we see a "cmd" value that resembles a known wire protocol command, we 169 # if we see a "cmd" value that resembles a known wire protocol command, we
170 # route it to a protocol handler. This is better than routing possible 170 # route it to a protocol handler. This is better than routing possible