Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat: Add support for complete domain names in the new URL prefix. (#8893)

QuietlyChanc1b2243adbdc
diff --git a/web/service/base.ts b/web/service/base.ts
index fcf8d8bd7d1..6cb732c55da 100644
--- a/web/service/base.ts
+++ b/web/service/base.ts
@@ -321,7 +321,9 @@ const baseFetch = <T>(
}
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)