Strip trailing slash from VITE_API_URL to prevent double-slash 404s
A trailing slash on the API base URL produced requests like ".com//api/signup" that 404'd, since every call site concatenates a leading-slash path directly onto BASE. Now stripped defensively regardless of how the env var is set. Also updated the fallback default to the current api.getodoomcp.com domain. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
f184887fb3
commit
dfd4f6cda9
@ -1,4 +1,8 @@
|
||||
const BASE = import.meta.env.VITE_API_URL ?? 'https://odoo-mcp.thedomainnest.com';
|
||||
// Strip any trailing slash regardless of how VITE_API_URL was set — every
|
||||
// call site below concatenates a leading-slash path directly onto BASE
|
||||
// (e.g. `${BASE}/api/signup`), so a trailing slash here would silently
|
||||
// produce a double-slash URL that 404s.
|
||||
const BASE = (import.meta.env.VITE_API_URL ?? 'https://api.getodoomcp.com').replace(/\/+$/, '');
|
||||
|
||||
// FastAPI's `detail` field is a plain string for handler-raised HTTPExceptions,
|
||||
// but an array of {loc, msg, type} objects for its own automatic request
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user