mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
default to strict mode but permit settings
This commit is contained in:
parent
5e3cbadffc
commit
bf065ee11d
@ -57,11 +57,11 @@ const DEFAULT_PORTS = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} ProxyOptions
|
* @typedef {Object} ProxyOptions
|
||||||
* @property {string} mode - Legacy mode is for non-strict previous proxy determination logic (node-red < v3.1) (default 'legacy')
|
* @property {'strict'|'legacy'} [mode] - Legacy mode is for non-strict previous proxy determination logic (for node-red <= v3.1 compatibility) (default 'strict')
|
||||||
* @property {boolean} favourUpperCase - Favour UPPER_CASE *_PROXY env vars (default false)
|
* @property {boolean} [favourUpperCase] - Favour UPPER_CASE *_PROXY env vars (default false)
|
||||||
* @property {boolean} lowerCaseOnly - Prevent UPPER_CASE *_PROXY env vars being used. (default false)
|
* @property {boolean} [lowerCaseOnly] - Prevent UPPER_CASE *_PROXY env vars being used. (default false)
|
||||||
* @property {boolean} excludeNpm - Prevent npm_config_*_proxy env vars being used. (default false)
|
* @property {boolean} [excludeNpm] - Prevent npm_config_*_proxy env vars being used. (default false)
|
||||||
* @property {object} env - The environment object to use (default process.env)
|
* @property {object} [env] - The environment object to use (defaults to process.env)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -74,16 +74,14 @@ const DEFAULT_PORTS = {
|
|||||||
function getProxyForUrl(url, options) {
|
function getProxyForUrl(url, options) {
|
||||||
url = url || ''
|
url = url || ''
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
mode: 'legacy', // TODO: change to 'strict' in V4.x
|
mode: 'strict',
|
||||||
lowerCaseOnly: false,
|
lowerCaseOnly: false,
|
||||||
favourUpperCase: false,
|
favourUpperCase: false,
|
||||||
excludeNpm: false,
|
excludeNpm: false,
|
||||||
}
|
}
|
||||||
options = Object.assign({}, defaultOptions, options)
|
options = Object.assign({}, defaultOptions, options)
|
||||||
|
|
||||||
//TODO: V4.x default: if mode is not set, default to strict mode
|
if (options.mode === 'legacy') {
|
||||||
// if (options.mode === 'legacy') {
|
|
||||||
if (options.mode !== 'strict') {
|
|
||||||
return legacyGetProxyForUrl(url, options.env || process.env)
|
return legacyGetProxyForUrl(url, options.env || process.env)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
packages/node_modules/node-red/settings.js
vendored
8
packages/node_modules/node-red/settings.js
vendored
@ -244,6 +244,14 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
//httpStaticRoot: '/static/',
|
//httpStaticRoot: '/static/',
|
||||||
|
|
||||||
|
/** The following property can be used to modify proxy options */
|
||||||
|
// proxyOptions: {
|
||||||
|
// mode: "legacy", // legacy mode is for non-strict previous proxy determination logic (node-red < v4 compatible)
|
||||||
|
// favourUpperCase: false, // Favour UPPER_CASE *_PROXY env vars
|
||||||
|
// lowerCaseOnly: false, // Prevent UPPER_CASE *_PROXY env vars being used.
|
||||||
|
// excludeNpm: false, // Prevent npm configured proxy env vars being used.
|
||||||
|
// },
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Runtime Settings
|
* Runtime Settings
|
||||||
* - lang
|
* - lang
|
||||||
|
Loading…
x
Reference in New Issue
Block a user