You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getRawUri no longer quotes the decoded value from HttpRequest.getUri() before passing the
assembled URL to URI.create. When Netty converts a valid path such as /session/id/foo%20bar to
/session/id/foo bar, every session request forwarded through the default JDK client can fail
before reaching its node.
The Netty converter builds Selenium's request from QueryStringDecoder.path(), whose documented
contract is to return the decoded path. Grid routes all /session/ traffic through HandleSession,
which creates a default JDK client and passes the decoded URI unchanged through
ReverseProxyHandler; the changed implementation then calls URI.create without restoring the
required escaping. A valid %20 therefore becomes an illegal literal space and raises
IllegalArgumentException before the upstream request is sent.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Valid percent-encoded request paths are decoded at the Netty boundary and subsequently rejected by the JDK HTTP client because the URI-quoting step was removed.
## Issue Context
Avoid guessing how arbitrary client-provided strings should be encoded, but preserve the original raw path when forwarding an already-valid inbound request. Add coverage proving that encoded spaces and non-ASCII path components survive Grid reverse proxying without double encoding.
## Fix Focus Areas
- java/src/org/openqa/selenium/netty/server/RequestConverter.java[158-166]
- java/src/org/openqa/selenium/grid/web/ReverseProxyHandler.java[59-73]
- java/src/org/openqa/selenium/remote/http/jdk/JdkHttpMessages.java[123-146]
- java/test/org/openqa/selenium/remote/internal/HttpClientTestBase.java[320-323]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Review mode: ⚖️ Balanced: This runtime HTTP URI behavior change removes encoding logic and its tests, creating compatibility and request-construction risk despite the localized two-file scope.
Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
🔗 Related Issues
Fixes #17994, sorry for the rude text in the issue.
💥 What does this PR do?
Remove the just added encoding step for URIs.
🔧 Implementation Notes
We should not hide incorrect calls to
HttpClient, so i removed this again.🤖 AI assistance
💡 Additional Considerations
🔄 Types of changes