Frontend Service: Client side redirect to custom domain (#113717)
* handle redirect in frontend service * add comments
This commit is contained in:
@@ -220,6 +220,16 @@
|
||||
}
|
||||
|
||||
const resp = await fetch(bootDataUrl);
|
||||
|
||||
// manual redirect for custom domains
|
||||
// see pkg/middleware/validate_host.go
|
||||
if (resp.status === 204) {
|
||||
const redirectDomain = resp.headers.get('Redirect-Domain');
|
||||
if (redirectDomain) {
|
||||
window.location.hostname = redirectDomain;
|
||||
return;
|
||||
}
|
||||
}
|
||||
const textResponse = await resp.text();
|
||||
|
||||
let rawBootData;
|
||||
|
||||
Reference in New Issue
Block a user