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

express

Package Overview
Dependencies
Maintainers
1
Versions
281
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 3.2.6 to 3.3.0

9

History.md
3.3.0 / 2013-06-26
==================
* update connect
* add support for multiple X-Forwarded-Proto values. Closes #1646
* change: remove charset from json responses. Closes #1631
* change: return actual booleans from req.accept* functions
* fix jsonp callback array throw
3.2.6 / 2013-06-02

@@ -3,0 +12,0 @@ ==================

1

lib/application.js

@@ -120,3 +120,2 @@ /**

app.handle(req, res, function(err){
req.app = res.app = orig;
req.__proto__ = orig.request;

@@ -123,0 +122,0 @@ res.__proto__ = orig.response;

@@ -41,4 +41,4 @@ /**

utils.merge(app, proto);
app.request = { __proto__: req };
app.response = { __proto__: res };
app.request = { __proto__: req, app: app };
app.response = { __proto__: res, app: app };
app.init();

@@ -45,0 +45,0 @@ return app;

@@ -20,3 +20,2 @@

return function expressInit(req, res, next){
req.app = res.app = app;
if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');

@@ -23,0 +22,0 @@ req.res = res;

@@ -113,3 +113,3 @@

req.acceptsEncoding = function(encoding){
return ~this.acceptedEncodings.indexOf(encoding);
return !! ~this.acceptedEncodings.indexOf(encoding);
};

@@ -129,3 +129,3 @@

return accepted.length
? ~accepted.indexOf(charset)
? !! ~accepted.indexOf(charset)
: true;

@@ -146,3 +146,3 @@ };

return accepted.length
? ~accepted.indexOf(lang)
? !! ~accepted.indexOf(lang)
: true;

@@ -351,7 +351,6 @@ };

var trustProxy = this.app.get('trust proxy');
return this.connection.encrypted
? 'https'
: trustProxy
? (this.get('X-Forwarded-Proto') || 'http')
: 'http';
if (this.connection.encrypted) return 'https';
if (!trustProxy) return 'http';
var proto = this.get('X-Forwarded-Proto') || 'http';
return proto.split(/\s*,\s*/)[0];
});

@@ -358,0 +357,0 @@

@@ -188,3 +188,2 @@ /**

// content-type
this.charset = this.charset || 'utf-8';
this.get('Content-Type') || this.set('Content-Type', 'application/json');

@@ -238,2 +237,3 @@

if (callback) {
if (callback instanceof Array) callback = callback[0];
this.set('Content-Type', 'text/javascript');

@@ -240,0 +240,0 @@ var cb = callback.replace(/[^\[\]\w$.]/g, '');

{
"name": "express",
"description": "Sinatra inspired web development framework",
"version": "3.2.6",
"version": "3.3.0",
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -25,3 +25,3 @@ "contributors": [

"dependencies": {
"connect": "2.7.11",
"connect": "2.8.0",
"commander": "0.6.1",

@@ -34,3 +34,3 @@ "range-parser": "0.0.4",

"methods": "0.0.1",
"send": "0.1.0",
"send": "0.1.1",
"cookie-signature": "1.0.1",

@@ -42,3 +42,3 @@ "debug": "*"

"mocha": "*",
"jade": "*",
"jade": "0.30.0",
"hjs": "*",

@@ -45,0 +45,0 @@ "stylus": "*",

@@ -1,17 +0,17 @@

var express = require('./');
var http = require('http');
var express = require('express');
var app = express();
var sub = express();
express.request.toJSON = function(){
return {
method: this.method,
url: this.url,
header: this.headers
}
};
app.use('/', function (req, res, next) {
next(new Error('something broke'));
});
app.get('*', function(req, res){
console.log(JSON.stringify(req));
res.send(200);
sub.use(function (err, req, res, next) {
res.send('error handled');
});
app.listen(4000)
app.use(sub);
http.createServer(app).listen(4000);
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