@@ -51,7 +51,7 @@ exports.header = function (uri, method, options) {
51
51
! method || typeof method !== 'string' ||
52
52
! options || typeof options !== 'object' ) {
53
53
54
- throw new Boom ( 'Invalid argument type' ) ;
54
+ throw new Boom . Boom ( 'Invalid argument type' ) ;
55
55
}
56
56
57
57
// Application time
@@ -66,11 +66,11 @@ exports.header = function (uri, method, options) {
66
66
! credentials . key ||
67
67
! credentials . algorithm ) {
68
68
69
- throw new Boom ( 'Invalid credentials' ) ;
69
+ throw new Boom . Boom ( 'Invalid credentials' ) ;
70
70
}
71
71
72
72
if ( Crypto . algorithms . indexOf ( credentials . algorithm ) === - 1 ) {
73
- throw new Boom ( 'Unknown algorithm' ) ;
73
+ throw new Boom . Boom ( 'Unknown algorithm' ) ;
74
74
}
75
75
76
76
// Parse URI
@@ -150,7 +150,7 @@ exports.authenticate = function (res, credentials, artifacts, options) {
150
150
var wwwAttributes = Utils . parseAuthorizationHeader ( res . headers [ 'www-authenticate' ] , [ 'ts' , 'tsm' , 'error' ] ) ;
151
151
}
152
152
catch ( err ) {
153
- throw new Boom ( 'Invalid WWW-Authenticate header' ) ;
153
+ throw new Boom . Boom ( 'Invalid WWW-Authenticate header' ) ;
154
154
}
155
155
156
156
result . headers [ 'www-authenticate' ] = wwwAttributes ;
@@ -160,7 +160,7 @@ exports.authenticate = function (res, credentials, artifacts, options) {
160
160
if ( wwwAttributes . ts ) {
161
161
const tsm = Crypto . calculateTsMac ( wwwAttributes . ts , credentials ) ;
162
162
if ( tsm !== wwwAttributes . tsm ) {
163
- throw new Boom ( 'Invalid server timestamp hash' , { decorate : result } ) ;
163
+ throw new Boom . Boom ( 'Invalid server timestamp hash' , { decorate : result } ) ;
164
164
}
165
165
}
166
166
}
@@ -169,7 +169,7 @@ exports.authenticate = function (res, credentials, artifacts, options) {
169
169
170
170
if ( ! res . headers [ 'server-authorization' ] ) {
171
171
if ( options . required ) {
172
- throw new Boom ( 'Missing Server-Authorization header' , { decorate : result } ) ;
172
+ throw new Boom . Boom ( 'Missing Server-Authorization header' , { decorate : result } ) ;
173
173
}
174
174
175
175
return result ;
@@ -179,7 +179,7 @@ exports.authenticate = function (res, credentials, artifacts, options) {
179
179
var serverAuthAttributes = Utils . parseAuthorizationHeader ( res . headers [ 'server-authorization' ] , [ 'mac' , 'ext' , 'hash' ] ) ;
180
180
}
181
181
catch ( err ) {
182
- throw new Boom ( 'Invalid Server-Authorization header' , { decorate : result } ) ;
182
+ throw new Boom . Boom ( 'Invalid Server-Authorization header' , { decorate : result } ) ;
183
183
}
184
184
185
185
result . headers [ 'server-authorization' ] = serverAuthAttributes ;
@@ -189,7 +189,7 @@ exports.authenticate = function (res, credentials, artifacts, options) {
189
189
190
190
const mac = Crypto . calculateMac ( 'response' , credentials , artifacts ) ;
191
191
if ( mac !== serverAuthAttributes . mac ) {
192
- throw new Boom ( 'Bad response mac' , { decorate : result } ) ;
192
+ throw new Boom . Boom ( 'Bad response mac' , { decorate : result } ) ;
193
193
}
194
194
195
195
if ( options . payload === null ||
@@ -199,12 +199,12 @@ exports.authenticate = function (res, credentials, artifacts, options) {
199
199
}
200
200
201
201
if ( ! serverAuthAttributes . hash ) {
202
- throw new Boom ( 'Missing response hash attribute' , { decorate : result } ) ;
202
+ throw new Boom . Boom ( 'Missing response hash attribute' , { decorate : result } ) ;
203
203
}
204
204
205
205
const calculatedHash = Crypto . calculatePayloadHash ( options . payload , credentials . algorithm , res . headers [ 'content-type' ] ) ;
206
206
if ( calculatedHash !== serverAuthAttributes . hash ) {
207
- throw new Boom ( 'Bad response payload mac' , { decorate : result } ) ;
207
+ throw new Boom . Boom ( 'Bad response payload mac' , { decorate : result } ) ;
208
208
}
209
209
210
210
return result ;
@@ -243,7 +243,7 @@ exports.getBewit = function (uri, options) {
243
243
typeof options !== 'object' ||
244
244
! options . ttlSec ) {
245
245
246
- throw new Boom ( 'Invalid inputs' ) ;
246
+ throw new Boom . Boom ( 'Invalid inputs' ) ;
247
247
}
248
248
249
249
const ext = ( options . ext === null || options . ext === undefined ? '' : options . ext ) ; // Zero is valid value
@@ -260,11 +260,11 @@ exports.getBewit = function (uri, options) {
260
260
! credentials . key ||
261
261
! credentials . algorithm ) {
262
262
263
- throw new Boom ( 'Invalid credentials' ) ;
263
+ throw new Boom . Boom ( 'Invalid credentials' ) ;
264
264
}
265
265
266
266
if ( Crypto . algorithms . indexOf ( credentials . algorithm ) === - 1 ) {
267
- throw new Boom ( 'Unknown algorithm' ) ;
267
+ throw new Boom . Boom ( 'Unknown algorithm' ) ;
268
268
}
269
269
270
270
// Parse URI
@@ -328,7 +328,7 @@ exports.message = function (host, port, message, options) {
328
328
message === null || message === undefined || typeof message !== 'string' ||
329
329
typeof options !== 'object' ) {
330
330
331
- throw new Boom ( 'Invalid inputs' ) ;
331
+ throw new Boom . Boom ( 'Invalid inputs' ) ;
332
332
}
333
333
334
334
// Application time
@@ -343,11 +343,11 @@ exports.message = function (host, port, message, options) {
343
343
! credentials . key ||
344
344
! credentials . algorithm ) {
345
345
346
- throw new Boom ( 'Invalid credentials' ) ;
346
+ throw new Boom . Boom ( 'Invalid credentials' ) ;
347
347
}
348
348
349
349
if ( Crypto . algorithms . indexOf ( credentials . algorithm ) === - 1 ) {
350
- throw new Boom ( 'Unknown algorithm' ) ;
350
+ throw new Boom . Boom ( 'Unknown algorithm' ) ;
351
351
}
352
352
353
353
// Calculate signature
0 commit comments