Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

check_header

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check_header - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

example.js

2

package.json
{
"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);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc