mirror of https://github.com/node-red/node-red.git
support env var NR_PROXY_MODE "legacy"|"strict"
parent
1cf7b95891
commit
283f7f5992
|
@ -55,6 +55,8 @@ const DEFAULT_PORTS = {
|
|||
mqtts: 8883
|
||||
}
|
||||
|
||||
const modeOverride = getEnv('NR_PROXY_MODE', {})
|
||||
|
||||
/**
|
||||
* @typedef {Object} ProxyOptions
|
||||
* @property {'strict'|'legacy'} [mode] - Legacy mode is for non-strict previous proxy determination logic (for node-red <= v3.1 compatibility) (default 'strict')
|
||||
|
@ -81,6 +83,10 @@ function getProxyForUrl(url, options) {
|
|||
}
|
||||
options = Object.assign({}, defaultOptions, options)
|
||||
|
||||
if (modeOverride === 'legacy' || modeOverride === 'strict') {
|
||||
options.mode = modeOverride
|
||||
}
|
||||
|
||||
if (options.mode === 'legacy') {
|
||||
return legacyGetProxyForUrl(url, options.env || process.env)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue