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

http-headers

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-headers - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

4

index.js

@@ -78,3 +78,5 @@ 'use strict'

function firstLine (str) {
return str.slice(0, str.indexOf('\r\n'))
var nl = str.indexOf('\r\n')
if (nl === -1) return str
else return str.slice(0, nl)
}

@@ -81,0 +83,0 @@

{
"name": "http-headers",
"version": "3.0.1",
"version": "3.0.2",
"description": "Parse http headers",

@@ -14,7 +14,8 @@ "main": "index.js",

"dependencies": {
"next-line": "^1.0.0"
"next-line": "^1.1.0"
},
"devDependencies": {
"standard": "^5.1.1",
"tape": "^4.2.0"
"safe-buffer": "^5.1.1",
"standard": "^10.0.2",
"tape": "^4.7.0"
},

@@ -38,5 +39,5 @@ "keywords": [

"coordinates": [
55.687709,
12.5955128
55.6757062,
12.5774478
]
}

@@ -29,3 +29,3 @@ # http-headers

connection: 'keep-alive',
'transfer-Encoding': 'chunked'
'transfer-encoding': 'chunked'
}

@@ -135,3 +135,3 @@ }

connection: 'keep-alive',
'transfer-Encoding': 'chunked'
'transfer-encoding': 'chunked'
}

@@ -164,3 +164,3 @@ }

connection: 'keep-alive',
'transfer-Encoding': 'chunked'
'transfer-encoding': 'chunked'
}

@@ -179,3 +179,3 @@ }

connection: 'keep-alive',
'transfer-Encoding': 'chunked'
'transfer-encoding': 'chunked'
}

@@ -203,3 +203,3 @@ ```

connection: 'keep-alive',
'transfer-Encoding': 'chunked'
'transfer-encoding': 'chunked'
}

@@ -206,0 +206,0 @@ ```

@@ -5,2 +5,3 @@ 'use strict'

var http = require('http')
var Buffer = require('safe-buffer').Buffer
var httpHeaders = require('./')

@@ -82,2 +83,32 @@

test('request-line only', function (t) {
var requestResult = {
method: 'GET',
url: '/foo',
version: { major: 1, minor: 1 },
headers: {}
}
t.deepEqual(httpHeaders(requestLine + '\r\n'), requestResult)
t.deepEqual(httpHeaders(new Buffer(requestLine + '\r\n')), requestResult)
t.deepEqual(httpHeaders(requestLine + '\r\n', true), {})
t.deepEqual(httpHeaders(new Buffer(requestLine + '\r\n'), true), {})
t.end()
})
test('status-line only', function (t) {
var responseResult = {
version: { major: 1, minor: 1 },
statusCode: 200,
statusMessage: 'OK',
headers: {}
}
t.deepEqual(httpHeaders(statusLine + '\r\n'), responseResult)
t.deepEqual(httpHeaders(new Buffer(statusLine + '\r\n')), responseResult)
t.deepEqual(httpHeaders(statusLine + '\r\n', true), {})
t.deepEqual(httpHeaders(new Buffer(statusLine + '\r\n'), true), {})
t.end()
})
test('headers only', function (t) {

@@ -84,0 +115,0 @@ t.deepEqual(httpHeaders(msgHeaders), headerResult)

Sorry, the diff of this file is not supported yet

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