Skip to content

Commit

Permalink
fix(viewer): 🐛 Ignoring port number when checking matching URL
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed May 20, 2022
1 parent 0f06aae commit 62162c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/viewer/pages/[[...publicId]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const getServerSideProps: GetServerSideProps = async (
if (!context.req.headers.host) return { props: {} }
const viewerUrls = (process.env.NEXT_PUBLIC_VIEWER_URL ?? '').split(',')
const isMatchingViewerUrl = viewerUrls.some((url) =>
context.req.headers.host?.includes(url.split('//')[1])
(context.req.headers.host ?? '')
.split(':')[0]
.includes(url.split('//')[1].split(':')[0])
)
const customDomain = `${context.req.headers.host}${
pathname === '/' ? '' : pathname
Expand All @@ -27,7 +29,7 @@ export const getServerSideProps: GetServerSideProps = async (
console.log(
isMatchingViewerUrl
? `Couldn't find publicId: ${context.query.publicId?.toString()}`
: `Couldn't customDomain: ${customDomain}`
: `Couldn't find customDomain: ${customDomain}`
)
return {
props: {
Expand Down

4 comments on commit 62162c6

@vercel
Copy link

@vercel vercel bot commented on 62162c6 May 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 62162c6 May 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 62162c6 May 20, 2022

@vercel
Copy link

@vercel vercel bot commented on 62162c6 May 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.