Skip to content

Support h2 upgrade#985

Open
cwe-dixa wants to merge 9 commits into
http4s:series/0.7from
cwe-dixa:feat/support-h2-upgrade
Open

Support h2 upgrade#985
cwe-dixa wants to merge 9 commits into
http4s:series/0.7from
cwe-dixa:feat/support-h2-upgrade

Conversation

@cwe-dixa

Copy link
Copy Markdown
Contributor

Some clients (like the jdk HttpClient) expects to be able to upgrade an h1 connection to h2 by sending an Upgrade header.

Previously, the library only supported prior-knowledge h2, but this pr adds support for h1 -> h2 upgrades.

Added a couple of tests to verify and all existing tests pass as well.

@cwe-dixa

Copy link
Copy Markdown
Contributor Author

Tests are failing with mima (missing class) because I deleted the now unused prior knowledge handler.

Should I bring it back?

@hamnis

hamnis commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

yes, bring it back. it can just be a stub that throws execptions everywhere.

@cwe-dixa

Copy link
Copy Markdown
Contributor Author

yes, bring it back. it can just be a stub that throws execptions everywhere.

Brought it back. Had to add some nowarns, since it now throws exceptions instead.

serverResource(routes).use { server =>
val addr = server.address
Resource
.make(IO.blocking(new Socket(addr.getHostName, addr.getPort)))(s =>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be Resource.fromAutocloseable ?

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