diff --git a/components/server/src/auth/auth-provider-service.ts b/components/server/src/auth/auth-provider-service.ts index 56fcdf2936fabe..851308766d5a28 100644 --- a/components/server/src/auth/auth-provider-service.ts +++ b/components/server/src/auth/auth-provider-service.ts @@ -415,8 +415,9 @@ export class AuthProviderService { async isHostReachable(host: string): Promise { try { - const resp = await fetch(`https://${host}`, { timeout: 2000 }); - return resp.ok; + // Don't attempt to follow redirects, and manually check response status code + const resp = await fetch(`https://${host}`, { timeout: 2000, redirect: "manual" }); + return resp.status <= 399; } catch (error) { console.log(`Host is not reachable: ${host}`); }