hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Add content-length header for http2 connections

Open lily-mara opened this issue 8 years ago • 7 comments

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.

lily-mara avatar Mar 02 '16 16:03 lily-mara

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.

Lukasa avatar Mar 02 '16 16:03 Lukasa

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?

Lukasa avatar Mar 02 '16 16:03 Lukasa

Yes, I'm working on the development branch, with up to #205.

lily-mara avatar Mar 02 '16 16:03 lily-mara

Hmm, that's perplexing. What's your environment? What Python are you using, what OpenSSL etc.?

Lukasa avatar Mar 02 '16 17:03 Lukasa

@natemara Do you want to try rebasing onto the current development branch and try again?

Lukasa avatar Mar 23 '16 17:03 Lukasa

Alright, that's rebased and checking now.

lily-mara avatar Mar 24 '16 14:03 lily-mara

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?

Lukasa avatar Mar 24 '16 17:03 Lukasa