diff --git a/go_cloud/internal/http/wopi_handlers.go b/go_cloud/internal/http/wopi_handlers.go index d98a865..941db42 100644 --- a/go_cloud/internal/http/wopi_handlers.go +++ b/go_cloud/internal/http/wopi_handlers.go @@ -5,7 +5,8 @@ import ( "fmt" "io" "net/http" - "net/url" + + //"net/url" "strings" "sync" "time" @@ -664,11 +665,8 @@ 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 - // Collabora expects: /cool/dist/cool.html?WOPISrc=... - editorURL := fmt.Sprintf("%s/cool/dist/cool.html?WOPISrc=%s&closebutton=1", collaboraURL, url.QueryEscape(wopiSrc)) - - // Return HTML page that loads Collabora in an iframe + // Return HTML page with auto-submitting form + // Collabora Online requires: POST to /cool/dist/cool.html with WOPISrc in request body htmlContent := fmt.Sprintf(` @@ -677,39 +675,33 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database. -
-
-

Loading Collabora Online...

-
- +
+

Loading Collabora Online...

+ + -`, editorURL, editorURL) +`, collaboraURL, wopiSrc) 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