fix cloudflare pages hostname redirection

This commit is contained in:
Ruben Fiszel
2022-11-27 14:17:09 +01:00
parent f1725c7eb9
commit f1446cd93e

View File

@@ -13,5 +13,7 @@ export async function onRequest(context: EventContext<unknown, string, unknown>)
const url = new URL(request.url)
url.hostname = "app.windmill.dev"
return fetch(url.toString(), { method: request.method, body: request.body, headers: request.headers, redirect: 'manual' })
const res = await fetch(url.toString(), { method: request.method, body: request.body, headers: request.headers, redirect: 'manual' })
res.headers.set('set-cookie', res.headers.get('set-cookie')?.replace('Domain=windmill.dev;', '') ?? '')
return res
}