Skip to content

Commit 8a6ba42

Browse files
committed
Fix discord webhook detection
1 parent 868420c commit 8a6ba42

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Share/BackgroundJobs/Webhooks/Worker.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,10 @@ buildWebhookRequest webhookId uri event defaultPayload = do
278278

279279
isDiscordWebhook :: URI -> Bool
280280
isDiscordWebhook uri =
281-
case (URI.uriRegName <$> URI.uriAuthority uri, URI.uriPath uri) of
282-
(Just regName, path) -> Text.isPrefixOf "discord.com" (Text.pack regName) && List.isPrefixOf path "/api/webhooks"
281+
case (URI.uriRegName <$> URI.uriAuthority uri) of
282+
Just regName ->
283+
Text.isPrefixOf "discord.com" (Text.pack regName)
284+
&& Text.isPrefixOf "/api/webhooks" (Text.pack $ URI.uriPath uri)
283285
_ -> False
284286

285287
buildDefaultPayload :: Either WebhookSendFailure HTTPClient.Request

0 commit comments

Comments
 (0)