From e0ba2407282ba7d59bc49b04a699f90d6b8ca082 Mon Sep 17 00:00:00 2001 From: Ayoub-Mabrouk Date: Thu, 7 Nov 2024 01:30:23 +0100 Subject: [PATCH] Refactor: Simplify Basic Authentication regex - Changed the regex for matching Basic Authentication credentials to use a case-insensitive flag. - Replaced explicit case handling for Basic with a single lowercase basic and the /i flag for improved readability. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9106e64..d98df07 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,7 @@ module.exports.parse = parse * @private */ -var CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/ +var CREDENTIALS_REGEXP = /^ *basic +([A-Za-z0-9._~+/-]+=*) *$/i /** * RegExp for basic auth user/pass