Add debug logging for X-WOPI-SuggestedTarget header and URL-encode WOPISrc in Collabora URL
This commit is contained in:
BIN
go_cloud/api
BIN
go_cloud/api
Binary file not shown.
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user