@hapi/boom
Advanced tools
Comparing version 7.4.3 to 7.4.4
@@ -98,3 +98,3 @@ 'use strict'; | ||
return (err instanceof Error && !!err.isBoom); | ||
return err instanceof Error && !!err.isBoom; | ||
} | ||
@@ -121,3 +121,3 @@ | ||
if (options.override === false || // Defaults to true | ||
(!options.statusCode && !options.message)) { | ||
!options.statusCode && !options.message) { | ||
@@ -137,3 +137,3 @@ return err; | ||
static unauthorized(message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) | ||
static unauthorized(message, scheme, attributes) { // Or (message, wwwAuthenticate[]) | ||
@@ -184,3 +184,2 @@ const err = new internals.Boom(message, { statusCode: 401, ctor: internals.Boom.unauthorized }); | ||
if (message) { | ||
@@ -197,15 +196,16 @@ if (attributes) { | ||
} | ||
err.output.headers['WWW-Authenticate'] = wwwAuthenticate; | ||
return err; | ||
} | ||
else { | ||
// function (message, wwwAuthenticate[]) | ||
// function (message, wwwAuthenticate[]) | ||
const wwwArray = scheme; | ||
for (let i = 0; i < wwwArray.length; ++i) { | ||
if (i) { | ||
wwwAuthenticate = wwwAuthenticate + ', '; | ||
} | ||
const wwwArray = scheme; | ||
for (let i = 0; i < wwwArray.length; ++i) { | ||
if (i) { | ||
wwwAuthenticate = wwwAuthenticate + ', '; | ||
} | ||
wwwAuthenticate = wwwAuthenticate + wwwArray[i]; | ||
} | ||
wwwAuthenticate = wwwAuthenticate + wwwArray[i]; | ||
} | ||
@@ -408,3 +408,3 @@ | ||
if (message) { | ||
err.message = (message + (err.message ? ': ' + err.message : '')); | ||
err.message = message + (err.message ? ': ' + err.message : ''); | ||
err.output.payload.message = err.message; | ||
@@ -411,0 +411,0 @@ } |
{ | ||
"name": "@hapi/boom", | ||
"description": "HTTP-friendly error objects", | ||
"version": "7.4.3", | ||
"version": "7.4.4", | ||
"repository": "git://github.com/hapijs/boom", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"keywords": [ | ||
@@ -11,2 +12,5 @@ "error", | ||
], | ||
"files": [ | ||
"lib" | ||
], | ||
"dependencies": { | ||
@@ -20,6 +24,6 @@ "@hapi/hoek": "8.x.x" | ||
"scripts": { | ||
"test": "lab -a @hapi/code -t 100 -L", | ||
"test-cov-html": "lab -a @hapi/code -r html -o coverage.html -L" | ||
"test": "lab -a @hapi/code -t 100 -L -Y", | ||
"test-cov-html": "lab -a @hapi/code -t 100 -L -r html -o coverage.html" | ||
}, | ||
"license": "BSD-3-Clause" | ||
} |
<a href="http://hapijs.com"><img src="https://raw.githubusercontent.com/hapijs/assets/master/images/family.png" width="180px" align="right" /></a> | ||
# boom | ||
# @hapi/boom | ||
@@ -5,0 +5,0 @@ HTTP-friendly error objects |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26982
6
691