Use /loleaflet/dist/loleaflet.html - standard Collabora Online WOPI endpoint

This commit is contained in:
Leon Bösche
2026-01-13 00:28:34 +01:00
parent 57eea172a2
commit c16cd49237

View File

@@ -666,7 +666,7 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database.
wopiSrc := fmt.Sprintf("https://go.b0esche.cloud/wopi/files/%s?access_token=%s", fileID, accessToken)
// Return HTML page with auto-submitting form
// Collabora Online requires: POST to /cool/dist/cool.html with WOPISrc in request body
// Collabora Online: POST WOPISrc as form data
htmlContent := fmt.Sprintf(`<!DOCTYPE html>
<html>
<head>
@@ -683,7 +683,7 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database.
<div class="loading">
<p>Loading Collabora Online...</p>
</div>
<form method="POST" action="%s/cool/dist/cool.html" target="collabora-frame" id="collaboraForm" style="display: none;">
<form method="POST" action="%s/loleaflet/dist/loleaflet.html" target="collabora-frame" id="collaboraForm" style="display: none;">
<input type="hidden" name="WOPISrc" value="%s">
</form>
<iframe name="collabora-frame" id="collabora-frame" style="position:fixed; top:0; left:0; width:100%%; height:100%%; border:none;"></iframe>
@@ -692,7 +692,7 @@ func collaboraProxyHandler(w http.ResponseWriter, r *http.Request, db *database.
setTimeout(function() {
var form = document.getElementById('collaboraForm');
if (form) {
console.log('[COLLABORA] Submitting form to /cool/dist/cool.html');
console.log('[COLLABORA] Submitting form to /loleaflet/dist/loleaflet.html');
form.submit();
} else {
console.error('[COLLABORA] Form not found');