Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit f83ff9f

Browse files
authored
fix: handle http protocol capitalization when checking links (#814)
1 parent 772c269 commit f83ff9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/links/checkLinks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import type { ExtendedClient } from '../interfaces/ExtendedClient.js';
44
import { errorHandler } from '../utils/errorHandler.js';
55

66
const allowedLinks = ['github.com', 'eddiejaoude.io', 'gitlab.com'];
7-
const urlPattern = /(http|https):\/\/([\w-]+(\.[\w-]+)+)(\/[\w-./?%&=]*)?/g;
7+
const urlPattern =
8+
/[Hh][Tt][Tt][Pp][Ss]?:\/\/([\w-]+(\.[\w-]+)+)(\/[\w-./?%&=]*)?/g;
89

910
export const checkLinks = async (
1011
bot: ExtendedClient,

0 commit comments

Comments
 (0)