[v22.x backport] http2: fix allowHttp1+Upgrade, broken by shouldUpgradeCallback by pimterry · Pull Request #60341 · nodejs/node

@pimterry

This is required to use HTTP/1 websockets on an HTTP/2 server, which is
fairly common as websockets over HTTP/2 is much less widely supported.

This was broken by the recent shouldUpgradeCallback HTTP/1 addition,
which wasn't correctly added to the corresponding allowHttp1 part of
the HTTP/2 implementation.

PR-URL: nodejs#59924
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

@nodejs-github-bot added http2

Issues or PRs related to the http2 subsystem.

needs-ci

PRs that need a full CI run.

v22.x

Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.

labels

Oct 21, 2025

marco-ippolito

@marco-ippolito marco-ippolito added v20.x

Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.

and removed v22.x

Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.

labels

Oct 22, 2025

@marco-ippolito marco-ippolito added v22.x

Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.

and removed v20.x

Issues that can be reproduced on v20.x or PRs targeting the v20.x-staging branch.

labels

Oct 22, 2025

@pimterry pimterry changed the title [v20.x backport] http2: fix allowHttp1+Upgrade, broken by shouldUpgradeCallback [v22.x backport] http2: fix allowHttp1+Upgrade, broken by shouldUpgradeCallback

Oct 22, 2025

richardlau

aduh95 pushed a commit that referenced this pull request

Oct 22, 2025
This is required to use HTTP/1 websockets on an HTTP/2 server, which is
fairly common as websockets over HTTP/2 is much less widely supported.

This was broken by the recent shouldUpgradeCallback HTTP/1 addition,
which wasn't correctly added to the corresponding allowHttp1 part of
the HTTP/2 implementation.

PR-URL: #59924
Backport-PR-URL: #60341
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

marco-ippolito pushed a commit that referenced this pull request

Nov 19, 2025
This is required to use HTTP/1 websockets on an HTTP/2 server, which is
fairly common as websockets over HTTP/2 is much less widely supported.

This was broken by the recent shouldUpgradeCallback HTTP/1 addition,
which wasn't correctly added to the corresponding allowHttp1 part of
the HTTP/2 implementation.

PR-URL: #59924
Backport-PR-URL: #60341
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

marco-ippolito pushed a commit that referenced this pull request

Nov 19, 2025
This is required to use HTTP/1 websockets on an HTTP/2 server, which is
fairly common as websockets over HTTP/2 is much less widely supported.

This was broken by the recent shouldUpgradeCallback HTTP/1 addition,
which wasn't correctly added to the corresponding allowHttp1 part of
the HTTP/2 implementation.

PR-URL: #59924
Backport-PR-URL: #60341
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

marco-ippolito pushed a commit that referenced this pull request

Nov 19, 2025
This is required to use HTTP/1 websockets on an HTTP/2 server, which is
fairly common as websockets over HTTP/2 is much less widely supported.

This was broken by the recent shouldUpgradeCallback HTTP/1 addition,
which wasn't correctly added to the corresponding allowHttp1 part of
the HTTP/2 implementation.

PR-URL: #59924
Backport-PR-URL: #60341
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>