diff --git a/web/service/base.ts b/web/service/base.ts index fcf8d8bd7d..6cb732c55d 100644 --- a/web/service/base.ts +++ b/web/service/base.ts @@ -321,7 +321,9 @@ const baseFetch = ( } const urlPrefix = isPublicAPI ? PUBLIC_API_PREFIX : API_PREFIX - let urlWithPrefix = `${urlPrefix}${url.startsWith('/') ? url : `/${url}`}` + let urlWithPrefix = (url.startsWith('http://') || url.startsWith('https://')) + ? url + : `${urlPrefix}${url.startsWith('/') ? url : `/${url}`}` const { method, params, body } = options // handle query @@ -494,7 +496,9 @@ export const ssePost = ( getAbortController?.(abortController) const urlPrefix = isPublicAPI ? PUBLIC_API_PREFIX : API_PREFIX - const urlWithPrefix = `${urlPrefix}${url.startsWith('/') ? url : `/${url}`}` + const urlWithPrefix = (url.startsWith('http://') || url.startsWith('https://')) + ? url + : `${urlPrefix}${url.startsWith('/') ? url : `/${url}`}` const { body } = options if (body)