hyper
hyper copied to clipboard
Add content-length header for http2 connections
If a body is defined, we should be sending a Content-Length header unless the request has the Transfer-Encoding header is set. This should fix #206. I was having some difficulty running the tests, but it seems like that was mostly related to SSL certificate problems. Looking at the spec doc, it says that clients SHOULD send the Content-Length header when there is no Transfer-Encoding header set.
Thanks for this @natemara! The test troubles are interesting, I've got a suspicion they're timing related, but I'll try to take a look and see if I can fix them so that we can write some tests for this.
Ok, so I can't reproduce your testing problems locally, and I believe I fixed all the relevant problems in #202. Does your local branch contain #202?
Yes, I'm working on the development branch, with up to #205.
Hmm, that's perplexing. What's your environment? What Python are you using, what OpenSSL etc.?
@natemara Do you want to try rebasing onto the current development branch and try again?
Alright, that's rebased and checking now.
Ok, so this is doing better. There are two things that need to be solved:
- we need to update the tests (see the Python 2 result for some problems)
- the function doesn't work as expected on Python 3 (for boring string type reasons)
Both of those will need to be fixed up. =) You up for doing that @natemara?