diff --git a/go_cloud/api b/go_cloud/api index d0b9070..c0b2300 100755 Binary files a/go_cloud/api and b/go_cloud/api differ diff --git a/go_cloud/internal/http/wopi_handlers.go b/go_cloud/internal/http/wopi_handlers.go index 0adcad1..a034780 100644 --- a/go_cloud/internal/http/wopi_handlers.go +++ b/go_cloud/internal/http/wopi_handlers.go @@ -561,6 +561,7 @@ func wopiPutFileHandler(w http.ResponseWriter, r *http.Request, db *database.DB, defer r.Body.Close() // Check for suggested target (used for export operations like Save as PDF) suggestedTarget := r.Header.Get("X-WOPI-SuggestedTarget") + fmt.Printf("[WOPI-EXPORT] X-WOPI-SuggestedTarget header: '%s'\n", suggestedTarget) isExport := suggestedTarget != "" var targetFile *database.File @@ -877,8 +878,11 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database. // Get the correct Collabora editor URL from discovery (includes version hash) editorURL := getCollaboraEditorURL(collaboraURL) + // URL-encode the WOPISrc for use in the form action URL (Collabora requires this) + encodedWopiSrc := url.QueryEscape(wopiSrc) + // Build the full Collabora URL with WOPISrc as query parameter - collaboraFullURL := fmt.Sprintf("%s?WOPISrc=%s", editorURL, wopiSrc) + collaboraFullURL := fmt.Sprintf("%s?WOPISrc=%s", editorURL, encodedWopiSrc) // Return HTML page with auto-submitting form // The form POSTs to Collabora with access_token in the body