Fix: Clean up whitespace in document viewer and WOPI handler files

This commit is contained in:
Leon Bösche
2026-01-12 16:10:40 +01:00
parent 42ee3057bf
commit 6db2bf077d
2 changed files with 4 additions and 3 deletions

View File

@@ -414,13 +414,13 @@ class _DocumentViewerModalState extends State<DocumentViewerModal> {
// 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';
}

View File

@@ -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)
}
}