RFR: 8368695: Support 101 switching protocol in jdk.httpserver [v5]
Josiah Noel
duke at openjdk.org
Wed Oct 15 17:10:11 UTC 2025
On Wed, 15 Oct 2025 16:13:15 GMT, Michael McMahon <michaelm at openjdk.org> wrote:
> Would this text be normative - that it - would any implementation plugged through the SPI need to support this?
While some implementations do it that way I'm not completely sure it's right to make all of them try to implement Upgrade.
> Maybe we could allow sendResponseHeaders to throw UnsupportedOperationException if the function is not supported.
Not totally sold on this
> Actually that won't work. Let me think about it ... It really needs to be a new method to allow for existing implementations that don't support it ... Something like sendUpgradeResponse() with a default implementation that throws UOE.
A separate method to do essentially the same thing as sendResponseHeaders? The main change is the implicit swap of the streams. I would be agreeable with this if `sendUpgradeResponse()` simply called `sendResponseHeaders(101, 0)` for convenience.
For context on why I would prefer to stick with `sendResponseHeaders`, there are other impls that currently support sending 101 in this way and I would like my code to be compatible so I can cleanly switch to the JDK implementation (Assuming the feature is accepted).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27751#issuecomment-3407455711
More information about the net-dev
mailing list