Skip to content

Commit

Permalink
fix: Don't allow us.posthog.com to be used (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
timgl authored Jan 11, 2024
1 parent 6520cb2 commit 6af384f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,11 @@ export class PostHog {

// We assume the api_host is without a trailing slash in most places throughout the codebase
this.config.api_host = this.config.api_host.replace(/\/$/, '')

// us.posthog.com is only for the web app, so we don't allow that to be used as a capture endpoint
if (this.config.api_host === 'https://us.posthog.com') {
this.config.api_host = 'https://app.posthog.com'
}
this.persistence?.update_config(this.config)
this.sessionPersistence?.update_config(this.config)

Expand Down

0 comments on commit 6af384f

Please sign in to comment.