From f83ff9f4ed79755021d1f603f77207bd7219f88c Mon Sep 17 00:00:00 2001 From: Dan <35927536+dan-mba@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:21:43 -0400 Subject: [PATCH] fix: handle http protocol capitalization when checking links (#814) --- src/links/checkLinks.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/links/checkLinks.ts b/src/links/checkLinks.ts index 77cdd6e4..ab3ab8ba 100644 --- a/src/links/checkLinks.ts +++ b/src/links/checkLinks.ts @@ -4,7 +4,8 @@ import type { ExtendedClient } from '../interfaces/ExtendedClient.js'; import { errorHandler } from '../utils/errorHandler.js'; const allowedLinks = ['github.com', 'eddiejaoude.io', 'gitlab.com']; -const urlPattern = /(http|https):\/\/([\w-]+(\.[\w-]+)+)(\/[\w-./?%&=]*)?/g; +const urlPattern = + /[Hh][Tt][Tt][Pp][Ss]?:\/\/([\w-]+(\.[\w-]+)+)(\/[\w-./?%&=]*)?/g; export const checkLinks = async ( bot: ExtendedClient,