Socket
Socket
Sign inDemoInstall

@nohost/router

Package Overview
Dependencies
3
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.2 to 0.9.0

32

lib/index.js

@@ -16,2 +16,9 @@ const url = require('url');

const CLIENT_ID = 'x-whistle-client-id';
const AUTH_URL = 'x-whistle-.script-auth-url';
const REQ_RULES_URL = 'x-whistle-.script-req-rules-url';
const RES_RULES_URL = 'x-whistle-.script-res-rules-url';
const STATS_URL = 'x-whistle-.script-stats-url';
const DATA_URL = 'x-whistle-.script-data-url';
const POLICY = 'x-whistle-.script-policy';
const URL_RE = /^http:(?:\/\/|%3A%2F%2F)[\w.-]/;
const CLIENT_ID_FILTER = 'x-whistle-filter-client-id';

@@ -56,2 +63,27 @@ const ROUTE_RE = /([?&])route=([^?&]+)($|&)/;

addHeader(CLIENT_ID, options.clientId);
let useRemote;
if (URL_RE.test(options.authUrl)) {
addHeader(AUTH_URL, options.authUrl);
useRemote = true;
}
const rulesUrl = options.rulesUrl || options.reqRulesUrl;
if (URL_RE.test(rulesUrl)) {
addHeader(REQ_RULES_URL, rulesUrl);
useRemote = true;
}
if (URL_RE.test(options.resRulesUrl)) {
addHeader(RES_RULES_URL, options.resRulesUrl);
useRemote = true;
}
if (URL_RE.test(options.statsUrl)) {
addHeader(STATS_URL, options.statsUrl);
useRemote = true;
}
if (URL_RE.test(options.dataUrl)) {
addHeader(DATA_URL, options.dataUrl);
useRemote = true;
}
if (useRemote) {
headers[POLICY] = 'remote';
}
}

@@ -58,0 +90,0 @@ addHeader(SPACE_NAME, options.spaceName);

2

package.json
{
"name": "@nohost/router",
"version": "0.8.2",
"version": "0.9.0",
"description": "Nohost cluster router",

@@ -5,0 +5,0 @@ "main": "lib/",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc