Commit b7984a7
committed
fix: accept the Discord webhook URLs Discord issues, and anchor the pattern
Three separate problems with the pattern this replaces:
1. `discordapp.com` was rejected. That host is still served and still handed
out, and the unescaped dot did not rescue it - "discord" plus any single
character plus "com" does not match "discordapp.com". The workaround
reporters found was to delete "app" from their own webhook URL.
2. The pattern was unanchored, and both ends check it with `RegExp.test`,
which matches anywhere in the string. Any URL at all that merely contained
a webhook-shaped substring was accepted - and the stored value is where
the speedtest results are then posted.
3. The leading `.*` accepted any host ending in the pattern, so
`notdiscord.com` passed.
The replacement also allows the `/api/v10/webhooks/...` form and Discord's
own `?thread_id=` parameter, both of which the old pattern rejected.
This fixes the half of #1297 about the URL not saving. Several reporters
also say the webhook saves and then never delivers; that is not addressed
here.
Refs #12971 parent 1a2045b commit b7984a7
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments