Re: HTTP/2 upgrade: how to send the response?

On 7/1/26 16:58, Ben Schwartz wrote:
> "Upgrade: HTTP/2.0" is a messy situation.  My view is that it does not
> exist, and the IANA registry entry that claims otherwise is incorrect,
> due to an oversight during development of the HTTP/2 RFCs.  I would
> support writing a new RFC to remove that entry from the registry (or
> marking it deprecated).

Definitely a good idea.

> See https://github.com/httpwg/http-extensions/issues/2737 for some
> earlier discussion of this question.  We also discussed it in HTTPBIS
> at IETF 120.
> 
> That said, I believe the original theory of "Upgrade: HTTP/*" was that
> the server's HTTP/X.Y data stream would start after the HTTP/1.1
> Upgrade response header, and would include the response to the POST
> request.
> 
> --Ben
Should there be a new RFC (or at least BCP) that updates processing
of the Upgrade header?  I suspect that the only useful Upgrade tokens
used in practice are either "websocket" or start with "connect-".

If one of these tokens is present, I'd be in favor of rejecting the
whole message in all of these situations:

- The Upgrade header appears more than once or contains ",".
  
- The token is in a response, the status is 101 Switching Protocols,
  and the token is different from the value in the request.

- The token is in a request, but the method is not GET.

- The token is in a request, but there is a Transfer-Encoding or
  Content-Length header.

- There is no "Upgrade" connection token.

- A request has "Upgrade: websocket" but no valid "Sec-WebSocket-Key"
  header.
  
- A response has "Upgrade: websocket" but no valid
  "Sec-WebSocket-Accept" header.

Otherwise, I think the whole Upgrade header should be ignored by
endpoints and stripped by intermediaries.  If the response was 101
Switching Protocols, the response ought to be rejected.

Thoughts on this?

> On Wed, Jul 1, 2026 at 4:32 PM Demi Marie Obenour <demiobenour@gmail.com> wrote:
>>
>> Suppose I send the following request:
>>
>> POST /something HTTP/1.1
>> Upgrade: HTTP/2.0
>> Connection: Upgrade
>> Content-Length: 8
>>
>> Example
>>
>> and get the following response:
>>
>> HTTP/1.1 101 Switching Protocols
>> Upgrade: HTTP/2.0
>> Connection: Upgrade
>>
>> How is the server supposed to send the response to the client?
>> --
>> Sincerely,
>> Demi Marie Obenour (she/her/hers)


-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

Received on Wednesday, 1 July 2026 22:23:45 UTC