From d58137716f1ad344ece15be0761111892bee583b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Mon, 12 Jan 2026 16:40:35 +0100 Subject: [PATCH] Fix: Collabora proxy should load iframe with WOPISrc in query string, not form submission - Changed from form POST submission to direct iframe load - WOPISrc goes in Collabora URL query string, not as form parameter - This matches Collabora's expected request format for WOPI integration --- go_cloud/internal/http/wopi_handlers.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/go_cloud/internal/http/wopi_handlers.go b/go_cloud/internal/http/wopi_handlers.go index 57c9883..930cd58 100644 --- a/go_cloud/internal/http/wopi_handlers.go +++ b/go_cloud/internal/http/wopi_handlers.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "net/http" + "net/url" "strings" "sync" "time" @@ -663,30 +664,33 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database. // Build WOPISrc URL wopiSrc := fmt.Sprintf("https://go.b0esche.cloud/wopi/files/%s?access_token=%s", fileID, accessToken) + // Build Collabora editor URL with WOPISrc in query string + collaboraEditorURL := fmt.Sprintf("%s/loleaflet/dist/loleaflet.html?WOPISrc=%s", collaboraURL, url.QueryEscape(wopiSrc)) + // Return HTML page with auto-submitting form htmlContent := fmt.Sprintf(` Loading Document...
Loading document in Collabora Online...
- + -`, collaboraURL, wopiSrc) +`, collaboraEditorURL) w.Header().Set("Content-Type", "text/html; charset=utf-8") // Don't set X-Frame-Options - this endpoint is meant to be loaded in an iframe