Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/request.py @ 36736: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 | af0a19d8812b |
children | 69b2d0900cd7 |
comparison
equal
deleted
inserted
replaced
36735:e79adc12cde3 | 36736:2442927cdd96 |
---|---|
46 if value is None: | 46 if value is None: |
47 value = form[k] | 47 value = form[k] |
48 form[name] = value | 48 form[name] = value |
49 del form[k] | 49 del form[k] |
50 # And strip the values | 50 # And strip the values |
51 bytesform = {} | |
51 for k, v in form.iteritems(): | 52 for k, v in form.iteritems(): |
52 form[k] = [i.strip() for i in v] | 53 bytesform[pycompat.bytesurl(k)] = [ |
53 return form | 54 pycompat.bytesurl(i.strip()) for i in v] |
55 return bytesform | |
54 | 56 |
55 class wsgirequest(object): | 57 class wsgirequest(object): |
56 """Higher-level API for a WSGI request. | 58 """Higher-level API for a WSGI request. |
57 | 59 |
58 WSGI applications are invoked with 2 arguments. They are used to | 60 WSGI applications are invoked with 2 arguments. They are used to |