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

express-http-proxy

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-http-proxy - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

12

index.js

@@ -34,2 +34,3 @@ var assert = require('assert');

port = h[1] || (ishttps ? 443 : 80);
port = String.prototype.replace.call(port, '/', '');
}

@@ -48,2 +49,3 @@

var limit = options.limit || '1mb';
var preserveHostHdr = options.preserveHostHdr;

@@ -58,3 +60,7 @@ return function handleProxy(req, res, next) {

var hds = extend(headers, req.headers, ['connection', 'host', 'content-length']);
var skipHdrs = [ 'connection', 'content-length' ];
if (!preserveHostHdr) {
skipHdrs.push('host');
}
var hds = extend(headers, req.headers, skipHdrs);
hds.connection = 'close';

@@ -75,3 +81,4 @@

path: path,
bodyContent: bodyContent
bodyContent: bodyContent,
params: req.params
};

@@ -85,2 +92,3 @@

delete reqOpt.bodyContent;
delete reqOpt.params;

@@ -87,0 +95,0 @@ if (typeof bodyContent == 'string')

2

package.json
{
"name": "express-http-proxy",
"version": "0.5.0",
"version": "0.6.0",
"description": "http proxy middleware for express",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -14,3 +14,3 @@ var assert = require('assert');

});
describe('test https', function() {

@@ -124,3 +124,3 @@ it('https', function(done) {

}));
request(app)

@@ -242,2 +242,29 @@ .get('/html')

describe('test url parsing', function() {
it('can parse a url with a port', function(done) {
var app = express();
app.use(proxy('http://localhost:9786'));
request(app)
.get('/')
.end(function(err, res) {
if (err) return done(err);
assert(true);
done();
});
});
it('does not throw `Uncaught RangeError` if you have both a port and a trailing slash', function(done) {
var app = express();
app.use(proxy('http://localhost:9786/'));
request(app)
.get('/')
.end(function(err, res) {
if (err) return done(err);
assert(true);
done();
});
});
});
});
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