Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce rawPath in RequestTarget #5932

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yzfeng2020
Copy link
Contributor

@yzfeng2020 yzfeng2020 commented Oct 2, 2024

Motivation:
It may be useful if we have access to the original request path unmodified. For example we have use cases where the decoding rules are different from the ones at decodedPath.

Modifications:

  • Added a rawPath in RequestTarget to store the rawPath.

Result:

@yzfeng2020 yzfeng2020 changed the title add rawPath to RequestTarget Introduce rawPath in RequestTarget Oct 2, 2024
@@ -645,7 +654,9 @@ private static RequestTarget slowForClient(String reqTarget,
null,
-1,
encodedPath,
encodedPath, encodedQuery,
encodedPath,
encodedPath,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tbh I am not sure what's the best behavior for client, I just reuse the encodedPath

@@ -169,6 +169,7 @@ default RoutingContext withPath(String path) {
oldReqTarget.port(),
pathWithoutMatrixVariables,
path,
path,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here, it seems like it's only going to modify the path but not query or fragment.

@@ -443,6 +451,7 @@ private static RequestTarget slowForServer(String reqTarget, boolean allowSemico
-1,
matrixVariablesRemovedPath,
encodedPath,
reqTarget,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

my read of the code is that the reqTarget here is the original one in Http2RequestDecoder but it actually may be modified at Http1RequestDecoder.

@yzfeng2020
Copy link
Contributor Author

hoping to get some feedbacks!

@yzfeng2020 yzfeng2020 marked this pull request as ready for review October 2, 2024 09:26
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.

Introduce rawPath in RequestTarget
1 participant