Repository navigation
Accept webhook URLs pasted twice or wrapped in quotes - #1
Merged
Merged
Conversation
The setup input field reads the clipboard on Ctrl+V by itself. In a
terminal that also pastes the text and forwards the key, the URL ends up
in the masked field twice ("...TOKENhttps://discord.com/..."), which failed
validation with "that does not look like a Discord webhook URL" even
though the copied URL was valid. Reported by a customer; reproduced by
feeding the field a paste plus Ctrl+V (168 characters for an 84-character
URL).
NormalizeWebhookURL now extracts the webhook from pasted text: the same
URL repeated, surrounding whitespace, quotes, and angle brackets are
accepted; two different URLs, a thread_id query, or other extra text are
rejected with a specific message. Setup confirms the URL it understood in
masked form and notes when it was pasted more than once. The scripted
--webhook-url-stdin path uses the same normalization.
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.
The setup input field reads the clipboard on Ctrl+V by itself. In a terminal that also pastes the text and forwards the key, the URL ends up in the masked field twice ("...TOKENhttps://discord.com/..."), which failed validation with "that does not look like a Discord webhook URL" even though the copied URL was valid. Reported by a customer; reproduced by feeding the field a paste plus Ctrl+V (168 characters for an 84-character URL).
NormalizeWebhookURL now extracts the webhook from pasted text: the same URL repeated, surrounding whitespace, quotes, and angle brackets are accepted; two different URLs, a thread_id query, or other extra text are rejected with a specific message. Setup confirms the URL it understood in masked form and notes when it was pasted more than once. The scripted --webhook-url-stdin path uses the same normalization.