httpwg / http-extensions

HTTP Extensions in progress
https://httpwg.org/http-extensions/
447 stars 146 forks source link

Make Capsule Protocol support mandatory for servers #2921

Closed bemasc closed 1 month ago

bemasc commented 1 month ago

This increases the complexity of a minimal server implementation and decreases the complexity of a rich client implementation.

Addresses #2855

DavidSchinazi commented 1 month ago

Another option would be to say that connect-tcp always uses capsules, that would reduce complexity even further

bemasc commented 1 month ago

Another option would be to say that connect-tcp always uses capsules, that would reduce complexity even further

That would reduce the complexity of a rich server implementation, but it would increase the complexity of a minimal client implementation. I don't think that is a wise trade.

DavidSchinazi commented 1 month ago

Do we think minimal client implementations will exist? I was imagining that they'd use regular CONNECT

LPardue commented 1 month ago

The spec probably wants more language to describe what a client should do when a server does not enable the capsule protocol, since thst a failure mode for this optional behaviour.

bemasc commented 1 month ago

@DavidSchinazi Template-based configuration is valuable with or without the capsule protocol. Also, if you're not actually using capsules, it adds bandwidth overhead without any benefit.

@LPardue We don't usually say "the server MUST $X, but if it doesn't the client SHOULD $Y". Is there a reason why that is necessary in this case?

LPardue commented 1 month ago

It seems weird to me that the server echos something back that the client doesn't check.

Since the server has a MUST requirement to process whatever format the client tells it, we could just drop the response header and state that a 2xx is the signal that server accepted connect-tcp with or without capsules.

bemasc commented 1 month ago

The response header is for the benefit of intermediaries. Clients don't rely on it. This is also true for CONNECT-UDP.

LPardue commented 1 month ago

That's a good point and might be worth saying explicitly in the text.

However, we do have a pattern in RFC9298 that levies requirements on request and response message and says "if any of these requirements are not met, the client MUST treat the procying attempt as failed and abort the request". Since connect-tcp levies a MUST about capsule-protocol on the response message, using similar text seems consistent to me.

DavidSchinazi commented 1 month ago

To move this discussion away from a merged PR and into an issue, I filed #2922