Skip to content

Conversation

@jparise
Copy link

@jparise jparise commented May 14, 2012

Detect when the server sends an HTTP 100 (Continue) response header
and kick our beautification loop into 'continuing' mode. While in
this mode, we wait for another ^HTTP/ header to be received before
responding to the \r\n break sequence signalling the end of the
headers and the start of the body. This gives us output like:

HTTP/1.1 100 (Continue)

HTTP/1.1 200 OK
Content-Length: 387
Content-Type: application/json; charset=UTF-8

{
}

This comes into play when uploading files using curlish.

Previously, these types of HTTP conversations were not "beautified"
because the header processing loop bailed out after the initial
HTTP/1.1 100 (Continue)\r\n\r\n content was handled.

Detect when the server sends an HTTP 100 (Continue) response header
and kick our beautification loop into 'continuing' mode.  While in
this mode, we wait for another ^HTTP/ header to be received before
responding to the `\r\n` break sequence signalling the end of the
headers and the start of the body.  This gives us output like:

    HTTP/1.1 100 (Continue)

    HTTP/1.1 200 OK
    Content-Length: 387
    Content-Type: application/json; charset=UTF-8

    {
    }

This comes into play when uploading files using curlish.

Previously, these types of HTTP conversations were not "beautified"
because the header processing loop bailed out after the initial
`HTTP/1.1 100 (Continue)\r\n\r\n` content was handled.
@mitsuhiko
Copy link
Contributor

I will apply this. I wonder though it it makes sense to match for HTTP/\d+\.\d+\s+100 instead of just one space.

@jparise
Copy link
Author

jparise commented May 30, 2012

That's probably a good improvement. The same would apply to the existing HTTP/\d+.\d+ [45]\d+ test, as well.

@jparise
Copy link
Author

jparise commented Oct 24, 2012

@mitsuhiko, would you consider merging this for a future release?

@mitsuhiko
Copy link
Contributor

Yes, will do that. Just have to check that it works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants