feat(xo-server): refresh HTTP proxy on config change

This commit is contained in:
Julien Fontanet 2022-07-21 10:42:23 +02:00
parent 11e09e1f87
commit 2fb27b26cd

View File

@ -16,12 +16,14 @@ export default class Http {
return this._agent
}
constructor(_, { config: { httpProxy, noProxy } }) {
if (httpProxy !== undefined) {
this._hasOwnHttpProxy = true
constructor(app) {
app.config.watch(({ httpProxy, noProxy }) => {
if (httpProxy !== undefined) {
this._hasOwnHttpProxy = true
this.setHttpProxy(httpProxy, noProxy)
}
this.setHttpProxy(httpProxy, noProxy)
}
})
}
httpRequest(...args) {