From 6db2bf077db4a6dcb71083c865ec463ce11efa34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Mon, 12 Jan 2026 16:10:40 +0100 Subject: [PATCH] Fix: Clean up whitespace in document viewer and WOPI handler files --- b0esche_cloud/lib/pages/document_viewer.dart | 4 ++-- go_cloud/internal/http/wopi_handlers.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/b0esche_cloud/lib/pages/document_viewer.dart b/b0esche_cloud/lib/pages/document_viewer.dart index d1f81d8..b879d87 100644 --- a/b0esche_cloud/lib/pages/document_viewer.dart +++ b/b0esche_cloud/lib/pages/document_viewer.dart @@ -414,13 +414,13 @@ class _DocumentViewerModalState extends State { // Build the proxy URL based on whether we're in org or user workspace String baseUrl = 'https://go.b0esche.cloud'; String endpoint; - + if (widget.orgId.isNotEmpty && widget.orgId != 'personal') { endpoint = '/orgs/${widget.orgId}/files/${widget.fileId}/collabora-proxy'; } else { endpoint = '/user/files/${widget.fileId}/collabora-proxy'; } - + // Pass token as query parameter for iframe (which cannot send Authorization header) return '$baseUrl$endpoint?token=$token'; } diff --git a/go_cloud/internal/http/wopi_handlers.go b/go_cloud/internal/http/wopi_handlers.go index c7ada1d..ae5cf83 100644 --- a/go_cloud/internal/http/wopi_handlers.go +++ b/go_cloud/internal/http/wopi_handlers.go @@ -603,6 +603,7 @@ func wopiSessionHandler(w http.ResponseWriter, r *http.Request, db *database.DB, fmt.Printf("[WOPI-REQUEST] Session created: file=%s user=%s\n", fileID, userID.String()) } + // CollaboraProxyHandler serves an HTML page that POSTs WOPISrc to Collabora // This avoids CORS issues by having the POST originate from our domain func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database.DB, jwtManager *jwt.Manager, collaboraURL string) { @@ -693,4 +694,4 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database. w.Write([]byte(htmlContent)) fmt.Printf("[COLLABORA-PROXY] Served HTML form: file=%s user=%s wopi_src=%s\n", fileID, userID.String(), wopiSrc) -} \ No newline at end of file +}