Skip to content

Commit

Permalink
siteForUrl: Bugfix - ignore query and search from input URL
Browse files Browse the repository at this point in the history
  • Loading branch information
apepper committed Oct 17, 2024
1 parent 5710236 commit 9c02c87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/config/scrivitoSites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ export function baseUrlForSite(siteId: string): string | undefined {
}

export function siteForUrl(
url: string,
fullUrl: string,
): { baseUrl: string; siteId: string } | undefined {
const parsedUrl = new URL(fullUrl)
const url = `${parsedUrl.origin}${parsedUrl.pathname}`

const neoletterBaseUrl = `https://mailing.neoletter.com/${getInstanceId()}`
if (url.startsWith(neoletterBaseUrl)) {
return { baseUrl: neoletterBaseUrl, siteId: NEOLETTER_MAILINGS_SITE_ID }
Expand Down

0 comments on commit 9c02c87

Please sign in to comment.