Comparing version 1.1.0 to 1.1.1
@@ -64,3 +64,3 @@ // Load modules | ||
if (settings.restful === false && | ||
if (settings.restful === false || | ||
(!request.route.plugins._crumb || request.route.plugins._crumb.restful === false)) { | ||
@@ -67,0 +67,0 @@ |
{ | ||
"name": "crumb", | ||
"description": "CSRF crumb generation and validation plugin", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -91,3 +91,3 @@ // Load modules | ||
{ | ||
method: 'POST', path: '/8', config: { plugins: { crumb: { restful: false } } }, handler: function (request, reply) { | ||
method: 'POST', path: '/8', config: { plugins: { crumb: { restful: false, source: 'payload' } } }, handler: function (request, reply) { | ||
@@ -162,4 +162,7 @@ expect(request.payload).to.deep.equal({ key: 'value' }); | ||
server.inject({ method: 'POST', url: '/8', payload: '{ "key": "value" }', headers: validHeader }, function (res) { | ||
var payload = { key: 'value', crumb: cookie[1] }; | ||
delete validHeader['x-csrf-token']; | ||
server.inject({ method: 'POST', url: '/8', payload: JSON.stringify(payload), headers: validHeader }, function (res) { | ||
expect(res.result).to.equal('valid'); | ||
@@ -166,0 +169,0 @@ done(); |
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
85216
366