Fix: Clean up whitespace in document viewer and WOPI handler files
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user