This commit is contained in:
2026-01-12 16:20:59 +11:00
parent b60256f61a
commit 170fae16da

View File

@@ -340,8 +340,8 @@ func buildDiagramsNetURL(r *http.Request, id string, xml string) string {
}
base := fmt.Sprintf("%s://%s/diagram?id=%s", scheme, r.Host, url.QueryEscape(id))
encoded := url.QueryEscape(base)
// Ask draw.io not to proxy (`proxy=0`) so it fetches directly (CORS headers are already set on /diagram).
return fmt.Sprintf("%s/?splash=0&ui=min&libs=aws4&proxy=0&url=%s", drawioBaseURL, encoded)
// Supply both url= and #U so either proxy or direct loaders work across hosted/self-hosted variants.
return fmt.Sprintf("%s/?splash=0&ui=min&libs=aws4&url=%s#U%s", drawioBaseURL, encoded, base)
}
func addCORS(w http.ResponseWriter) {