From 88ffd3dec44c0e5cc9276a92af02df007fc25ef5 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Wed, 11 Dec 2024 15:18:13 +0000 Subject: [PATCH] chore(internal): update isAbsoluteURL --- src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index f1964058..23fd50c6 100644 --- a/src/core.ts +++ b/src/core.ts @@ -986,8 +986,8 @@ export const safeJSON = (text: string) => { } }; -// https://stackoverflow.com/a/19709846 -const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i'); +// https://url.spec.whatwg.org/#url-scheme-string +const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; const isAbsoluteURL = (url: string): boolean => { return startsWithSchemeRegexp.test(url); };