Socket
Socket
Sign inDemoInstall

negotiator

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

negotiator - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

.travis.yml

15

lib/mediaType.js

@@ -46,5 +46,5 @@ module.exports = preferredMediaTypes;

function getMediaTypePriority(type, accepted) {
return (accepted.filter(function(a) {
return (accepted.map(function(a) {
return specify(type, a);
}).sort(function (a, b) {
}).filter(Boolean).sort(function (a, b) {
// revsort

@@ -70,11 +70,10 @@ return a.s > b.s ? -1 : 1;

if (spec.params) {
var keys = Object.keys(spec.params);
if (keys.some(function (k) {
var keys = Object.keys(spec.params);
if (keys.length > 0) {
if (keys.every(function (k) {
return spec.params[k] == '*' || spec.params[k] == p.params[k];
})) {
return null;
s |= 1
} else {
s |= 1;
return null
}

@@ -81,0 +80,0 @@ }

{
"name": "negotiator",
"description": "HTTP content negotiation",
"version": "0.4.1",
"version": "0.4.2",
"author": "Federico Romero <federico.romero@outboxlabs.com>",

@@ -22,3 +22,3 @@ "contributors": ["Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)"],

"devDependencies": {
"nodeunit": "0.6.x"
"nodeunit": "0.8.x"
},

@@ -25,0 +25,0 @@ "scripts": {

@@ -1,2 +0,2 @@

# Negotiator
# Negotiator [![Build Status](https://travis-ci.org/federomero/negotiator.png)](https://travis-ci.org/federomero/negotiator)

@@ -3,0 +3,0 @@ An HTTP content negotiator for node.js written in javascript.

@@ -70,3 +70,36 @@ (function() {

selected: ['text/plain', 'text/html']
}, {
accept: 'application/json, */*; q=0.01',
provided: ['text/html', 'application/json'],
selected: ['application/json', 'text/html']
}, {
accept: 'application/vnd.example;attribute=value',
provided: ['application/vnd.example;attribute=other', 'application/vnd.example;attribute=value'],
selected: ['application/vnd.example;attribute=value']
}, {
accept: 'application/vnd.example;attribute=other',
provided: ['application/vnd.example', 'application/vnd.example;attribute=other'],
selected: ['application/vnd.example;attribute=other']
}, {
accept: 'text/html;level=1',
provided: ['text/html;level=1;foo=bar'],
selected: ['text/html;level=1;foo=bar']
}, {
accept: 'text/html;level=1;foo=bar',
provided: ['text/html;level=1'],
selected: []
}, {
accept: 'text/html;level=2',
provided: ['text/html;level=1'],
selected: []
}, {
accept : 'text/html, text/html;level=1;q=0.1',
provided : ['text/html', 'text/html;level=1'],
selected : ['text/html', 'text/html;level=1']
}, {
accept : 'text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5',
provided : ['text/html;level=1', 'text/html', 'text/html;level=3', 'image/jpeg', 'text/html;level=2', 'text/plain'],
selected : ['text/html;level=1', 'text/html', 'text/html;level=3', 'image/jpeg', 'text/html;level=2', 'text/plain']
}
];

@@ -73,0 +106,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