check_header
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "check_header", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Check if headers aren't invalid for correct use in setHeader or writeHead functions", | ||
@@ -5,0 +5,0 @@ "main": "lib/", |
@@ -15,4 +15,4 @@ # Check Header | ||
var headersObject = {'Content-Type':'žluťoučký kůň'}; | ||
if (checker.checkHeaders(headersObject)) { | ||
if (!checker.isValid(headersObject)) { | ||
console.log("Invalid header there!"); | ||
} |
@@ -9,10 +9,14 @@ var assert = require('chai').assert; | ||
}); | ||
it ('Check invalid header', function(){ | ||
it ('Check invalid header in both parts', function(){ | ||
var headersObject = {'Příliš':'žluťoučký kůň'}; | ||
assert.equal(headers.isValid(headersObject), false); | ||
}); | ||
it ('Check invalid header', function(){ | ||
it ('Check invalid header value', function(){ | ||
var headersObject = {'Content-Type':'žluťoučký kůň'}; | ||
assert.equal(headers.isValid(headersObject), false); | ||
}); | ||
it ('Check invalid header name', function(){ | ||
var headersObject = {'Příliš':'application/json'}; | ||
assert.equal(headers.isValid(headersObject), false); | ||
}); | ||
}); |
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
4594
8
65