New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cf-api

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cf-api - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

.npmignore

4

middleware/accepts.js

@@ -9,4 +9,4 @@ module.exports = acceptMiddleware

// If no 'Accept: x' header then bye
if (!req.headers.accept) return res.sendStatus(406)
// If no 'Accept: x' header assume anything is allowed
if (!req.headers.accept) req.headers.accept = '*/*'

@@ -13,0 +13,0 @@ // Get the list of acceptable response types

@@ -5,3 +5,3 @@ {

"description": "A pluggable JSON API server",
"version": "2.4.0",
"version": "2.5.0",
"tags": [],

@@ -8,0 +8,0 @@ "license": "ISC",

@@ -17,6 +17,6 @@ var request = require('supertest')

it('should send a 406 response to a request with no "Accept"', function (done) {
it('should assume a `*/*` "Accept" header to a request with no "Accept"', function (done) {
request(app)
.get('/')
.expect(406, done)
.expect(200, done)
})

@@ -23,0 +23,0 @@

@@ -6,8 +6,7 @@ var assert = require('assert')

it('should send a 406 response to a request with no "Accept"', function (done) {
it('should assume */* "Accept" header to a request with no "Accept"', function (done) {
function mockStatus(statusCode) {
assert.equal(406, statusCode)
done()
assert.equal(200, statusCode)
}
middleware({ headers: {} }, { sendStatus: mockStatus })
middleware({ headers: {} }, { sendStatus: mockStatus }, done)
})

@@ -14,0 +13,0 @@

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