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

express-http-proxy

Package Overview
Dependencies
Maintainers
3
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.7.0 to 0.7.1

35

index.js

@@ -21,22 +21,9 @@ var assert = require('assert');

if (typeof host == 'string') {
var mc = host.match(/^(https?:\/\/)/);
if (mc) {
host = host.substring(mc[1].length);
}
var parsedHost = null;
if (typeof host != 'function') {
parsedHost = parseHost(host.toString());
if (isError(parsedHost))
throw parsedHost;
}
var h = host.split(':');
if (h[1] === '443') {
ishttps = true;
}
host = h[0];
port = h[1] || (ishttps ? 443 : 80);
port = String.prototype.replace.call(port, '/', '');
} else {
port = ishttps ? 443 : 80;
}
port = options.port || port;
/**

@@ -68,5 +55,7 @@ * intercept(targetResponse, data, res, req, function(err, json));

var parsedHost = parseHost((typeof host == 'function') ? host(req) : host.toString());
if (isError(parsedHost))
next(parsedHost);
if (!parsedHost) {
parsedHost = parseHost((typeof host == 'function') ? host(req) : host.toString());
if (isError(parsedHost))
throw parsedHost;
}

@@ -106,3 +95,3 @@ // var hasRequestBody = 'content-type' in req.headers || 'transfer-encoding' in req.headers;

delete reqOpt.params;
if (err && !bodyContent) return next(err);

@@ -109,0 +98,0 @@

{
"name": "express-http-proxy",
"version": "0.7.0",
"version": "0.7.1",
"description": "http proxy middleware for express",

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

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

var https = express();
https.use( proxy(function() { return 'httpbin.org'; }, {https: true}) );
https.use(proxy(function() { return 'httpbin.org'; }, {https: true}) );
request(https)

@@ -42,0 +42,0 @@ .get('/user-agent')

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