Set Host header for static app tunnel routing
This commit is contained in:
parent
31ca1d9849
commit
c634d488b6
|
|
@ -180,6 +180,9 @@ function openTunnel(appName: string, port: number, subdomain?: string, isReconne
|
||||||
onRequest(req) {
|
onRequest(req) {
|
||||||
const app = getApp(appName)
|
const app = getApp(appName)
|
||||||
if (app?.tunnelUrl) req.headers['x-app-url'] = app.tunnelUrl
|
if (app?.tunnelUrl) req.headers['x-app-url'] = app.tunnelUrl
|
||||||
|
// Static apps are served by the main server via subdomain routing,
|
||||||
|
// so set the Host header so extractSubdomain() can identify the app
|
||||||
|
if (app?.static) req.headers['host'] = `${appName}.localhost`
|
||||||
},
|
},
|
||||||
|
|
||||||
onOpen(assignedSubdomain) {
|
onOpen(assignedSubdomain) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user