diff --git a/lib/index.js b/lib/index.js index 6d125ee..39627c1 100755 --- a/lib/index.js +++ b/lib/index.js @@ -1,6 +1,6 @@ 'use strict'; -const Hoek = require('@hapi/hoek'); +const EscapeHeaderAttribute = require('@hapi/hoek/escapeHeaderAttribute'); const internals = { @@ -275,14 +275,14 @@ exports.unauthorized = internals.statusError(401, (message, scheme, attributes) if (attributes) { if (typeof attributes === 'string') { - stringified += Hoek.escapeHeaderAttribute(attributes); + stringified += EscapeHeaderAttribute(attributes); } else { stringified += Object.keys(attributes).map((name) => { const value = attributes[name] ?? ''; - return `${name}="${Hoek.escapeHeaderAttribute(value.toString())}"`; + return `${name}="${EscapeHeaderAttribute(value.toString())}"`; }) .join(', '); } @@ -293,7 +293,7 @@ exports.unauthorized = internals.statusError(401, (message, scheme, attributes) stringified += ', '; } - stringified += `error="${Hoek.escapeHeaderAttribute(message)}"`; + stringified += `error="${EscapeHeaderAttribute(message)}"`; } else { decorate.isMissing = true;