From 44b19f355db2ee0687a0dc9542b7c9950a1fed65 Mon Sep 17 00:00:00 2001 From: Xavier Vello Date: Tue, 17 Oct 2023 15:28:10 +0200 Subject: [PATCH] remove pre-flight check --- src/posthog-core.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/posthog-core.ts b/src/posthog-core.ts index 9be52a3a5..4f5f0ad80 100644 --- a/src/posthog-core.ts +++ b/src/posthog-core.ts @@ -534,16 +534,8 @@ export class PostHog { this.compression = compression } - // Allow the backend to override the `/e/` endpoint, check that it's reachable before using - // We can only run the check if XHR is available. - if (response.analytics?.endpoint && USE_XHR) { - const endpoint = response.analytics?.endpoint - this._send_request( - this.config.api_host + endpoint, - {}, - { method: 'OPTIONS' }, - () => (this.analyticsDefaultEndpoint = endpoint) - ) + if (response.analytics?.endpoint) { + this.analyticsDefaultEndpoint = response.analytics.endpoint } }