Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
py3: Be able to read and write non-ASCII headers
Apparently Python's stdlib got more picky about what a header should look like. As a result, if an account, container, or object had a non-ASCII metadata name (values were fine), the proxy-server wouldn't parse all of the headers. See https://bugs.python.org/issue37093 for more information. This presented several problems: - Since the non-ASCII header aborts parsing, we may lose important HTTP-level information like Content-Length or Transfer-Encoding. - Since the offending header wouldn't get parsed, the client wouldn't even know what the problem was. - Even if the client knew what the bad header was, it would have no way to clear it, as the server uses the same logic to parse incoming requests. So, hack in our own header parsing if we detect that parsing was aborted. Note that we also have to mangle bufferedhttp's putheader so we can get non-ASCII headers to the backend servers. Now, we can run the test_unicode_metadata tests in test/functional/test_account.py and test/functional/test_container.py under py2 against services running under py3. Change-Id: I0f03c211f35a9a49e047a5718a9907b515ca88d7
- Loading branch information