httpcore icon indicating copy to clipboard operation
httpcore copied to clipboard

Support informational responses with HTTP/1.1

Open lovelydinosaur opened this issue 3 years ago • 2 comments

Prompted by https://github.com/encode/httpcore/discussions/572#discussion-4348090

lovelydinosaur avatar Sep 29 '22 11:09 lovelydinosaur

Thank you! Just a quick question: should 1xx responses on non-streaming requests return? With this PR they do but I'm not sure that's intentional. (I think they should definitely return for streaming requests, though)

Here's the bit in specific I'm not sure about:

A client MUST be able to parse one or more 1xx responses received prior to a final response, even if the client does not expect one. A user agent MAY ignore unexpected 1xx responses.

source

A5rocks avatar Sep 29 '22 15:09 A5rocks

Just a quick question: should 1xx responses on non-streaming requests return?

Yes, I think that's okay. You'll end up with a 101 response, with body that'll stream the network content.

At the httpx layer that'd typically effectively mean you'd get a 101 response, that'd then result in a read timeout waiting for some response content.

But you'd need to have sent an upgrade request in the first place, so you'd have to deliberately do odd things, and you'd end up in a reasonable failure state.

lovelydinosaur avatar Sep 30 '22 10:09 lovelydinosaur