URL-encode WOPISrc in Collabora URL to ensure proper handling in query parameters

This commit is contained in:
Leon Bösche
2026-02-05 16:08:29 +01:00
parent c49b2d2805
commit cc8a1e9ce6
2 changed files with 5 additions and 2 deletions

Binary file not shown.

View File

@@ -878,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)
// WOPISrc is passed unencoded in the query parameter
collaboraFullURL := fmt.Sprintf("%s?WOPISrc=%s", editorURL, wopiSrc)
// URL-encode the WOPISrc for use in the query parameter (Collabora expects this)
encodedWopiSrc := url.QueryEscape(wopiSrc)
// Build the full Collabora URL with WOPISrc as query parameter
collaboraFullURL := fmt.Sprintf("%s?WOPISrc=%s", editorURL, encodedWopiSrc)
// Return HTML page with auto-submitting form
// No access_token needed in body since it's in WOPISrc