mirror of
https://github.com/Dvorinka/excalidraw-full.git
synced 2026-06-03 22:02:57 +00:00
更新主机地址替换逻辑,支持通过环境变量配置后端主机,增强反向代理和跨域支持。
This commit is contained in:
@@ -87,7 +87,12 @@ func handleUI() http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
modifiedContent := strings.ReplaceAll(string(fileContent), "firestore.googleapis.com", "localhost:3002")
|
// 替换为请求的url对应的domain,使其在反向代理或不同域名下也能正常工作。
|
||||||
|
backendHost := os.Getenv("EXCALIDRAW_BACKEND_HOST")
|
||||||
|
if backendHost == "" {
|
||||||
|
backendHost = r.Host
|
||||||
|
}
|
||||||
|
modifiedContent := strings.ReplaceAll(string(fileContent), "firestore.googleapis.com", backendHost)
|
||||||
modifiedContent = strings.ReplaceAll(modifiedContent, "ssl=!0", "ssl=0")
|
modifiedContent = strings.ReplaceAll(modifiedContent, "ssl=!0", "ssl=0")
|
||||||
modifiedContent = strings.ReplaceAll(modifiedContent, "ssl:!0", "ssl:0")
|
modifiedContent = strings.ReplaceAll(modifiedContent, "ssl:!0", "ssl:0")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user