feat: configurable VITE_WS_API_URL + harden POST→GET shim#480
Merged
Conversation
- Only convert string/number/boolean values to query params (skip objects, nested arrays, __proto__ etc.) to prevent prototype pollution vectors - Skip body parsing for Content-Length > 1MB to avoid memory pressure
Replace hardcoded api.worldmonitor.app with VITE_WS_API_URL env var. When empty, installWebApiRedirect() is skipped entirely — relative /api/* calls stay on the same domain (local installs). When set, browser fetch is redirected to that URL. Also adds VITE_WS_API_URL and VITE_WS_RELAY_URL hostnames to APP_HOSTS allowlist dynamically.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
koala73
added a commit
that referenced
this pull request
Mar 1, 2026
* fix(gateway): harden POST→GET shim with scalar guard and size limit - Only convert string/number/boolean values to query params (skip objects, nested arrays, __proto__ etc.) to prevent prototype pollution vectors - Skip body parsing for Content-Length > 1MB to avoid memory pressure * feat: make API base URL configurable via VITE_WS_API_URL Replace hardcoded api.worldmonitor.app with VITE_WS_API_URL env var. When empty, installWebApiRedirect() is skipped entirely — relative /api/* calls stay on the same domain (local installs). When set, browser fetch is redirected to that URL. Also adds VITE_WS_API_URL and VITE_WS_RELAY_URL hostnames to APP_HOSTS allowlist dynamically.
Summary
Follow-up to #477 (merged with only the initial POST→GET shim).
api.worldmonitor.appwithVITE_WS_API_URLenv var. When empty,installWebApiRedirect()is skipped — relative/api/*calls stay on same domain (local installs). When set, browser fetch redirects to that URL.VITE_WS_API_URLandVITE_WS_RELAY_URLhostnames added to allowlist automaticallyDeployment note
Set
VITE_WS_API_URL=https://api.worldmonitor.appin Vercel environment variables before merging. Without it, the web API redirect won't activate on production.Test plan
tsc --noEmitpassesVITE_WS_API_URL=https://api.worldmonitor.app:/api/*calls redirect correctlyVITE_WS_API_URLempty:/api/*calls stay on same domain