Repository navigation
fix: encode the redirect URL passed to the login page - #591
Open
dungdong-aws wants to merge 1 commit into
Open
dungdong-aws wants to merge 1 commit into
dungdong-aws wants to merge 1 commit into
Conversation
The login view handed the redirect URL to the page by concatenating it into a script string. Write it as an escaped string literal instead, so the page receives every URL as text. Sign-in URLs are passed to the page and shown as before.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The login view passes the sign-in redirect URL to its page by concatenating the URL into a script string. A URL that contains a quote or a backslash is not passed to the page as the URL text.
Change
UpdateRedirectUrlCommand.toScript()builds the script and writes the URL as an escaped string literal.ToolkitLoginWebview.onEventruns that script.Behavior after this change
Testing
UpdateRedirectUrlCommandTest: plain URL, quotes and backslashes, line terminators, control characters, and a round trip of the script argument back to the original URL.ToolkitLoginWebviewTest: the view runs the script for a live browser and does nothing for a disposed one.mvn -B clean package: build passes, 536 tests, 0 Checkstyle violations.