swift/swift
Tim Burke a317d33dbc bufferedhttp: ensure query params are properly quoted
Recent versions of py27 [1] have begun raising InvalidURL if you try to
include non-ASCII characters in the request path. This was observed
recently in the periodic checks of stable/ocata and stable/pike. In
particular, we would spin up some in-process servers in
test.unit.proxy.test_server.TestSocketObjectVersions and do a container
listing with a prefix param that included raw (unquoted) UTF-8. This
query string would pass unmolested through the proxy, tripping the
InvalidURL error when bufferedhttp called putrequest.

More recent versions of Swift would not exhibit this particular failure,
as the listing_formats middleware would force a decoding/re-encoding of
the query string for account and container requests. However, object
requests with errant query strings would likely be able to trip the same
error.

Swift on py3 should not exhibit this behavior, as we so
thoroughly re-write the request line to avoid hitting
https://bugs.python.org/issue33973.

Now, always parse and re-encode the query string in bufferedhttp. This
prevents any errors on object requests and cleans up any callers that
might use bufferedhttp directly.

[1] Anything after https://github.com/python/cpython/commit/bb8071a;
    see https://bugs.python.org/issue30458

Closes-Bug: 1843816
Change-Id: I73f84b96f164e6fc5d3cb890355871c26ed271a6
Related-Change: Id3ce37aa0402e2d8dd5784ce329d7cb4fbaf700d
Related-Change: Ie648f5c04d4415f3b620fb196fa567ce7575d522
(cherry picked from commit 49f62f6ab7)
2019-09-20 21:13:47 -07:00
..
account Use check_drive consistently 2017-11-01 16:33:40 +00:00
cli Merge "Change exit code when displaying empty rings" 2018-01-11 12:16:56 +00:00
common bufferedhttp: ensure query params are properly quoted 2019-09-20 21:13:47 -07:00
container add symlink to container sync default and sample config 2017-12-14 12:13:20 -08:00
locale Imported Translations from Zanata 2018-03-14 06:53:42 +00:00
obj Merge "Include policy in ran-out-of-handoffs log message" 2018-01-24 10:52:22 +00:00
proxy Merge "Increase name-length limits for internal accounts" 2018-01-31 00:29:29 +00:00
__init__.py Make pbr a build-time only dependency 2013-10-29 12:29:49 -07:00