Forward h2c upgrade request downstream so that it gets a response [Fixes #5005] #6270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From NettyServerUpgradeHandler: "The upgrade was successful, remove the message from the output list so that it's not propagated to the next handler. This request will be propagated as a user event instead."
So, the first request is discarded. This patch sends it downstream for normal handling.
Build is failing locally but that seems unrelated, so we'll see what CI says.
I'm not 100% on whether this patch could duplicate the request, but since it is a
FullHttpRequest
that is being forwarded, it should be safe – no partial data to worry about or anything. The fact that theupgradeRequest
will still contain headers related to the upgrade may also be a concern, since it allows an attacker to send these headers further downstream than before. But I think that after the upgrade is complete, an attacker could send the same headers anyway.