Skip to content

Commit

Permalink
use editor url for origin check (#5783)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruggi authored May 29, 2024
1 parent 587a5b2 commit 9922360
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utopia-remix/app/util/assets.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import urlJoin from 'url-join'
import { ServerEnvironment } from '../env.server'
import { BrowserEnvironment } from '../env.server'
import { allowedAssetExtensions } from '../handlers/splatLoad'
import { canAccessProject } from '../handlers/validators'
import { UserProjectPermission } from '../types'
Expand Down Expand Up @@ -39,7 +39,7 @@ export function getProjectIdFromReferer(req: Request): string | null {

const refererURL = new URL(referer)
const isMaybeProjectReferer =
refererURL.origin === ServerEnvironment.CORS_ORIGIN &&
refererURL.origin === BrowserEnvironment.EDITOR_URL &&
(refererURL.pathname.startsWith('/p/') || refererURL.pathname.startsWith('/project/'))
if (!isMaybeProjectReferer) {
return null
Expand Down

0 comments on commit 9922360

Please sign in to comment.