fix(mixins/HttpProxy): don't fail on missing httpServer

Introduced by 98641631a

Similar to bc7fc750f

Which is the case when instanciated from `xo-server-recover-account`.
This commit is contained in:
Julien Fontanet
2022-05-02 13:33:18 +02:00
parent 8ed8447665
commit a66ae33d5d
2 changed files with 8 additions and 0 deletions

View File

@@ -30,6 +30,13 @@ module.exports = class HttpProxy {
#app
constructor(app, { httpServer }) {
// don't setup the proxy if httpServer is not present
//
// that can happen when the app is instanciated in another context like xo-server-recover-account
if (httpServer === undefined) {
return
}
this.#app = app
const events = new EventListenersManager(httpServer)

View File

@@ -28,4 +28,5 @@
>
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- @xen-orchestra/mixins patch
- xo-server patch