cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl http/2 cleartext upgrade for POST request

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 21 Sep 2015 00:12:23 +0200 (CEST)

On Thu, 17 Sep 2015, Francisco Moraes wrote:

> While testing cleartext upgrade with curl, I noticed a few things when
> testing an upgrade for a POST request (no issues that I recall with a GET
> request):
>
> - if I send the 101 response before sending the 100 Continue (due to Expect
> header), curl seems to hang and doesn't send the payload. Instead, I got the
> http/2 preface sent

Hm, ok. But what on earth does a server expect a client to do with the payload
when it switches protocol in the midst of the request like that?

> - if I respond to the request with 100 Continue and only send the 101 after
> the payload has been fully received, I get the behavior that seems to match
> the spec
>
> Can you comment on what's the correct order here? I know that cleartext
> upgrade containing a payload doesn't seem to be a good idea and I am
> debating whether to even support it, but wanted to get your thoughts on
> this.

We discussed exactly this case on the httpbis mailing list maybe a year ago or
so and I believe the conclusion was that the 100-continue has to come before
the 101. Since you tried this, what did you expect curl to do when you sent
the 101 before the 100?

Another thing we learned then is that this is a primary reason why several
server implementations don't even do upgrades on POST.

> Also, curl doesn't seem to send a GOAWAY frame before closing the connection
> (see https://httpwg.github.io/specs/rfc7540.html#6.8).

Ah right. We really SHOULD adhere to that SHOULD... but also, when we close
the connection immediately, the point of a GOAWAY decreases.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-09-21