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.4 to 1.1.0

.eslintcache

18

lib/headers.js

@@ -7,4 +7,5 @@ // From NodeJS - https://github.com/nodejs/node/commit/2a2d3e1b0333441d1bd00def06d687f807067f6e

// field-vchar = VCHAR / obs-text
'use strict';
function checkInvalidHeaderChar(val) {
val = '' + val;
for (var i = 0; i < val.length; i++) {

@@ -28,10 +29,10 @@ var ch = val.charCodeAt(i);

if (headers.hasOwnProperty(property)) {
if (checkInvalidHeaderChar(headers[property])===true) {
return false;
}
if (checkIsHttpToken(property)===false) {
return false;
}
if (checkInvalidHeaderChar(headers[property]) === true) {
return false;
}
if (checkIsHttpToken(property) === false) {
return false;
}
}
}
}
return true;

@@ -45,1 +46,2 @@ }

};
//# sourceMappingURL=headers.map

@@ -0,1 +1,4 @@

'use strict';
module.exports = require('./headers');
//# sourceMappingURL=index.map
{
"name": "check_header",
"version": "1.0.4",
"version": "1.1.0",
"description": "Check if headers aren't invalid for correct use in setHeader or writeHead functions",
"main": "lib/",
"scripts": {
"test": "./node_modules/.bin/mocha"
"test": "peasant test",
"cover": "peasant cover",
"lint": "peasant lint",
"peasant": "peasant",
"ci": "peasant -s lint test build",
"prepublish": "npm run ci"
},

@@ -17,6 +22,6 @@ "repository": {

"keywords": [
"header",
"http",
"setHeader",
"writeHead"
"header",
"http",
"setHeader",
"writeHead"
],

@@ -26,5 +31,7 @@ "author": "abtris",

"devDependencies": {
"mocha": "*",
"chai": "*"
"peasant": "0.5.2"
},
"dependencies": {
"babel-runtime": "6.5.0"
}
}

@@ -10,12 +10,14 @@ [![npm version](https://badge.fury.io/js/check_header.svg)](https://badge.fury.io/js/check_header)

npm install check_header
```sh
npm install --save check_header
```
## Example
var checker = require('check_header');
var headersObject = {'Content-Type':'žluťoučký kůň'};
if (!checker.isValid(headersObject)) {
console.log("Invalid header there!");
}
```js
var checker = require('check_header');
var headersObject = {'Content-Type':'žluťoučký kůň'};
if (!checker.isValid(headersObject)) {
console.log("Invalid header there!");
}
```

Sorry, the diff of this file is not supported yet

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