Fix URL parsing in gravity.sh - #6689
Open
rdwebdesign wants to merge 1 commit into
Open
rdwebdesign wants to merge 1 commit into
rdwebdesign wants to merge 1 commit into
Conversation
Fix awk command to return the domain even when there is a "@" character in the middle of the URL: "http://domain.com/path@version/file.txt" The new command first removes the protocol, then removes the "@" character, but only when it appears in the first part, before the domain: "http://username:password@domain.com/file.txt" The old command removed everything (including the actual domain) before the "@" character, unconditionally. Fix #6685 Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
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.
What does this PR aim to accomplish?
Fix awk command to return the domain even when there is a "@" character in the middle of the URL: "http://domain.com/path@version/file.txt"
The new command first removes the protocol, then removes the "@" character, but only when it appears in the first part, before the domain: "http://username:password@domain.com/file.txt"
The old command removed everything (including the actual domain) before the "@" character, unconditionally.
Fix #6685
How does this PR accomplish the above?
Changing the
awkcommand to use 2 separategsubcalls. One for the protocol and another one to filter credentials. The new command uses a different regex, that removes text only when the "@" character appears before the domain.By submitting this pull request, I confirm the following:
git rebase)