mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
support env var NR_PROXY_MODE "legacy"|"strict"
This commit is contained in:
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…
x
Reference in New Issue
Block a user