From b14975dd9b19bedd97698ed6039b3abca2bc5d25 Mon Sep 17 00:00:00 2001 From: Suriya Date: Wed, 20 May 2026 17:38:03 +0530 Subject: [PATCH] endpointfix --- src/components/TopicView.jsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/TopicView.jsx b/src/components/TopicView.jsx index ce61ac4..0a25faf 100644 --- a/src/components/TopicView.jsx +++ b/src/components/TopicView.jsx @@ -2,17 +2,14 @@ import { useEffect, useRef, useState } from 'react' import EndpointCard from './EndpointCard' import { getTopicIcon } from '../lib/icons' -import { LEGACY_BASE_URL, REST_BASE_URL } from '../data/topics' +import { LEGACY_BASE_URL } from '../data/topics' const ADMIN_SECRET = 'nearle-admin-secret' -function toProxyPath(fullUrl, baseUrl) { - // REST (jupiter.nearle.app): strip base so /live/... goes through Vite proxy - 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. +function toProxyPath(fullUrl) { + // Always fetch the full URL directly. + // Legacy (api.workolik.com): CORS open, admin secret injected in headers. + // REST (jupiter.nearle.app): fetched directly, no proxy needed. return fullUrl } @@ -69,7 +66,7 @@ export default function TopicView({ topic, searchQuery }) { } } - const res = await fetch(toProxyPath(composedUrl, topic.baseUrl), fetchOptions) + const res = await fetch(toProxyPath(composedUrl), fetchOptions) const ms = Date.now() - start const text = await res.text() let body