diff options
| author | Fuwn <[email protected]> | 2026-04-18 08:46:53 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-18 08:46:53 +0000 |
| commit | 5b95492f0ac2f0b5afd3f212c3d568c9b7d61d97 (patch) | |
| tree | babb7d269c6c79c6067f08da9f37323477f5fe09 | |
| parent | build(dev): use portless for named .localhost dev URL (diff) | |
| download | due.moe-5b95492f0ac2f0b5afd3f212c3d568c9b7d61d97.tar.xz due.moe-5b95492f0ac2f0b5afd3f212c3d568c9b7d61d97.zip | |
fix(dev): route portless .localhost URL through app origin and proxy CORS
| -rw-r--r-- | apps/proxy/src/index.js | 1 | ||||
| -rw-r--r-- | package.json | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/apps/proxy/src/index.js b/apps/proxy/src/index.js index 592899c0..fa2503b5 100644 --- a/apps/proxy/src/index.js +++ b/apps/proxy/src/index.js @@ -18,6 +18,7 @@ const isPrivateHostname = (hostname) => hostname === "localhost" || hostname === "127.0.0.1" || hostname.endsWith(".local") || + hostname.endsWith(".localhost") || /^10\./.test(hostname) || /^192\.168\./.test(hostname) || /^172\.(1[6-9]|2\d|3[0-1])\./.test(hostname); diff --git a/package.json b/package.json index f29b7c19..cf138b81 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { - "dev": "portless due vite dev", + "dev": "PUBLIC_APP_ORIGIN=https://due.localhost portless due vite dev", "graphql:generate": "pnpm exec sveltekit-graphql generate", "build": "pnpm run graphql:generate && vite build", "preview": "vite preview", |