зеркало из https://github.com/mozilla/hawk.git
Checks correctly routes auth strategy
When setting the default auth strategy hawk didn't respect that and crashed with: TypeError: Cannot read property 'payload' of undefined
This commit is contained in:
Родитель
39797fc54e
Коммит
8f9d56b203
|
@ -42,7 +42,7 @@ internals.hawk = function (server, options) {
|
||||||
return h.unauthenticated(err, credentials ? { credentials, artifacts } : undefined);
|
return h.unauthenticated(err, credentials ? { credentials, artifacts } : undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.route.settings.auth.payload) {
|
if (server.auth.lookup(request.route)) {
|
||||||
request.events.once('peek', (chunk) => {
|
request.events.once('peek', (chunk) => {
|
||||||
|
|
||||||
const payloadHash = Crypto.initializePayloadHash(request.auth.credentials.algorithm, request.headers['content-type']);
|
const payloadHash = Crypto.initializePayloadHash(request.auth.credentials.algorithm, request.headers['content-type']);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче