Socket
Socket
Sign inDemoInstall

express

Package Overview
Dependencies
Maintainers
7
Versions
279
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express - npm Package Compare versions

Comparing version 4.11.2 to 4.12.0

40

lib/application.js

@@ -0,3 +1,12 @@

/*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* Module dependencies.
* @api private
*/

@@ -29,2 +38,9 @@

/**
* Variable for trust proxy inheritance back-compat
* @api private
*/
var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default';
/**
* Initialize the server.

@@ -62,6 +78,19 @@ *

// trust proxy inherit back-compat
Object.defineProperty(this.settings, trustProxyDefaultSymbol, {
configurable: true,
value: true
});
debug('booting in %s mode', env);
// inherit protos
this.on('mount', function(parent){
this.on('mount', function onmount(parent) {
// inherit trust proxy
if (this.settings[trustProxyDefaultSymbol] === true
&& typeof parent.settings['trust proxy fn'] === 'function') {
delete this.settings['trust proxy'];
delete this.settings['trust proxy fn'];
}
// inherit protos
this.request.__proto__ = parent.request;

@@ -332,2 +361,9 @@ this.response.__proto__ = parent.response;

this.set('trust proxy fn', compileTrust(val));
// trust proxy inherit back-compat
Object.defineProperty(this.settings, trustProxyDefaultSymbol, {
configurable: true,
value: false
});
break;

@@ -334,0 +370,0 @@ }

8

lib/request.js

@@ -66,8 +66,8 @@ /**

*
* The `type` value may be a single mime type string
* such as "application/json", the extension name
* such as "json", a comma-delimted list such as "json, html, text/plain",
* The `type` value may be a single MIME type string
* such as "application/json", an extension name
* such as "json", a comma-delimited list such as "json, html, text/plain",
* an argument list such as `"json", "html", "text/plain"`,
* or an array `["json", "html", "text/plain"]`. When a list
* or array is given the _best_ match, if any is returned.
* or array is given, the _best_ match, if any is returned.
*

@@ -74,0 +74,0 @@ * Examples:

@@ -0,3 +1,11 @@

/*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* Module dependencies.
* @api private
*/

@@ -162,11 +170,8 @@

// method check
var isHead = req.method === 'HEAD';
// ETag support
if (len !== undefined && (isHead || req.method === 'GET')) {
var etag = app.get('etag fn');
if (etag && !this.get('ETag')) {
etag = etag(chunk, encoding);
etag && this.set('ETag', etag);
// populate ETag
var etag;
var generateETag = len !== undefined && app.get('etag fn');
if (typeof generateETag === 'function' && !this.get('ETag')) {
if ((etag = generateETag(chunk, encoding))) {
this.set('ETag', etag);
}

@@ -186,3 +191,3 @@ }

if (isHead) {
if (req.method === 'HEAD') {
// skip body for HEAD

@@ -189,0 +194,0 @@ this.end();

@@ -0,6 +1,15 @@

/*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* Module dependencies.
* @api private
*/
var contentDisposition = require('content-disposition');
var contentType = require('content-type');
var deprecate = require('depd')('express');

@@ -13,3 +22,2 @@ var mime = require('send').mime;

var querystring = require('querystring');
var typer = require('media-typer');

@@ -262,7 +270,9 @@ /**

exports.setCharset = function(type, charset){
if (!type || !charset) return type;
exports.setCharset = function setCharset(type, charset) {
if (!type || !charset) {
return type;
}
// parse type
var parsed = typer.parse(type);
var parsed = contentType.parse(type);

@@ -273,3 +283,3 @@ // set charset

// format type
return typer.format(parsed);
return contentType.format(parsed);
};

@@ -276,0 +286,0 @@

{
"name": "express",
"description": "Fast, unopinionated, minimalist web framework",
"version": "4.11.2",
"version": "4.12.0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -30,5 +30,6 @@ "contributors": [

"dependencies": {
"accepts": "~1.2.3",
"accepts": "~1.2.4",
"content-disposition": "0.5.0",
"cookie-signature": "1.0.5",
"content-type": "~1.0.1",
"cookie-signature": "1.0.6",
"debug": "~2.1.1",

@@ -40,3 +41,2 @@ "depd": "~1.0.0",

"fresh": "0.2.4",
"media-typer": "0.3.0",
"methods": "~1.1.1",

@@ -49,5 +49,5 @@ "on-finished": "~2.2.0",

"range-parser": "~1.0.2",
"send": "0.11.1",
"serve-static": "~1.8.1",
"type-is": "~1.5.6",
"send": "0.12.1",
"serve-static": "~1.9.1",
"type-is": "~1.6.0",
"vary": "~1.0.0",

@@ -60,14 +60,14 @@ "cookie": "0.1.2",

"after": "0.8.1",
"ejs": "2.1.4",
"istanbul": "0.3.5",
"ejs": "2.3.1",
"istanbul": "0.3.6",
"marked": "0.3.3",
"mocha": "~2.1.0",
"should": "~4.6.2",
"should": "~5.0.1",
"supertest": "~0.15.0",
"hjs": "~0.0.6",
"body-parser": "~1.11.0",
"body-parser": "~1.12.0",
"connect-redis": "~2.2.0",
"cookie-parser": "~1.3.3",
"express-session": "~1.10.2",
"jade": "~1.9.1",
"cookie-parser": "~1.3.4",
"express-session": "~1.10.3",
"jade": "~1.9.2",
"method-override": "~2.3.1",

@@ -90,6 +90,6 @@ "morgan": "~1.5.1",

"test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",
"test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/"
"test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"
}
}

@@ -7,3 +7,4 @@ [![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)

[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][travis-image]][travis-url]
[![Linux Build][travis-image]][travis-url]
[![Windows Build][appveyor-image]][appveyor-url]
[![Test Coverage][coveralls-image]][coveralls-url]

@@ -125,13 +126,15 @@

[npm-image]: https://img.shields.io/npm/v/express.svg?style=flat
[npm-image]: https://img.shields.io/npm/v/express.svg
[npm-url]: https://npmjs.org/package/express
[downloads-image]: https://img.shields.io/npm/dm/express.svg?style=flat
[downloads-image]: https://img.shields.io/npm/dm/express.svg
[downloads-url]: https://npmjs.org/package/express
[travis-image]: https://img.shields.io/travis/strongloop/express.svg?style=flat
[travis-image]: https://img.shields.io/travis/strongloop/express/master.svg?label=linux
[travis-url]: https://travis-ci.org/strongloop/express
[coveralls-image]: https://img.shields.io/coveralls/strongloop/express.svg?style=flat
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
[coveralls-image]: https://img.shields.io/coveralls/strongloop/express/master.svg
[coveralls-url]: https://coveralls.io/r/strongloop/express?branch=master
[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg?style=flat
[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg
[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/
[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg?style=flat
[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg
[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/

Sorry, the diff of this file is too big to display

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