graphqlfix
This commit is contained in:
@@ -7,9 +7,12 @@ import { LEGACY_BASE_URL, REST_BASE_URL } from '../data/topics'
|
|||||||
const ADMIN_SECRET = 'nearle-admin-secret'
|
const ADMIN_SECRET = 'nearle-admin-secret'
|
||||||
|
|
||||||
function toProxyPath(fullUrl, baseUrl) {
|
function toProxyPath(fullUrl, baseUrl) {
|
||||||
if (fullUrl.startsWith(baseUrl)) {
|
// REST (jupiter.nearle.app): strip base so /live/... goes through Vite proxy
|
||||||
return fullUrl.slice(baseUrl.length)
|
if (baseUrl === REST_BASE_URL && fullUrl.startsWith(REST_BASE_URL)) {
|
||||||
|
return fullUrl.slice(REST_BASE_URL.length)
|
||||||
}
|
}
|
||||||
|
// Legacy (api.workolik.com): CORS is open — fetch the full URL directly.
|
||||||
|
// Admin secret is injected in the request header, so no proxy needed.
|
||||||
return fullUrl
|
return fullUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user