New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

http-server-proxy

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-server-proxy - npm Package Compare versions

Comparing version
0.11.1
to
0.11.2
+12
-13
lib/http-server.js

@@ -112,20 +112,19 @@ 'use strict';

if (typeof options.proxy === 'string') {
// console.log(options.apiPrefix);
var proxy = httpProxy.createProxyServer({});
before.push(function (req, res) {
let proxyUrl = options.proxy;
console.log(options.apiPrefix, req.url.match(options.apiPrefix));
if(options.apiPrefix && req.url.match(options.apiPrefix) && req.headers.cookie){
const res = /proxy_api_url=([^;]+)(;.*|$)/.exec(req.headers.cookie);
if(res && res[1]) {
// console.log(res);
proxyUrl = res[1];
}
}
proxy.web(req, res, {
target: options.proxy,
target: proxyUrl,
changeOrigin: true,
secure: false,
router: options.apiPrefix ? function(req) {
// console.log(req);
// console.log(apiUrl);
if(req.path.match(options.apiPrefix) && req.headers.cookie){
const res = /proxy_api_url=([^;]+)(;.*|$)/.exec(req.headers.cookie);
if(res && res[1]) {
// console.log(res);
return res[1];
}
}
return options.proxy;
} : undefined,
});

@@ -132,0 +131,0 @@ });

{
"name": "http-server-proxy",
"version": "0.11.1",
"version": "0.11.2",
"description": "A simple zero-configuration command-line http server",

@@ -5,0 +5,0 @@ "main": "./lib/http-server",

Sorry, the diff of this file is not supported yet