mirror of https://github.com/langgenius/dify.git
Fix the bug of automatically appending basepath to image resource. (#24201)
This commit is contained in:
parent
d12255025c
commit
f0684c1957
|
|
@ -10,7 +10,7 @@ export default function RoutePrefixHandle() {
|
|||
const addPrefixToImg = (e: HTMLImageElement) => {
|
||||
const url = new URL(e.src)
|
||||
const prefix = url.pathname.slice(0, basePath.length)
|
||||
if (prefix !== basePath && !url.href.startsWith('blob:') && !url.href.startsWith('data:')) {
|
||||
if (prefix !== basePath && !url.href.startsWith('blob:') && !url.href.startsWith('data:') && !url.href.startsWith('http')) {
|
||||
url.pathname = basePath + url.pathname
|
||||
e.src = url.toString()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue