Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ const token68 = '([\\w.~+/-]+=*)'
/**
* @see https://datatracker.ietf.org/doc/html/rfc7235#appendix-C
*/
const credentialsStrictRE = new RegExp(`^${authScheme} ${token68}$`, 'i')
const credentialsStrictRE = new RegExp(`^${authScheme} ${token68}$`, 'iu')

const credentialsLaxRE = new RegExp(`^${BWS}*${authScheme}${BWS}+${token68}${BWS}*$`, 'i')
const credentialsLaxRE = new RegExp(`^${BWS}*${authScheme}${BWS}+${token68}${BWS}*$`, 'iu')

/**
* @see https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1
*/
// eslint-disable-next-line no-control-regex
const controlRE = /[\x00-\x1F\x7F]/
const controlRE = /[\x00-\x1F\x7F]/u

/**
* RegExp for basic auth user/pass
Expand All @@ -59,7 +59,7 @@ const controlRE = /[\x00-\x1F\x7F]/
* password = *TEXT
*/

const userPassRE = /^([^:]*):(.*)$/
const userPassRE = /^([^:]*):(.*)$/u

/** @type {typeof import('./types/index').fastifyBasicAuth} */
async function fastifyBasicAuth (fastify, opts) {
Expand Down