fix file preview url
Build and Push Docker Container / build-and-push (push) Successful in 1m30s

This commit is contained in:
2026-04-11 11:35:39 +02:00
parent 1c58de68b6
commit 3d8d74785c
2 changed files with 16 additions and 3 deletions
+8 -1
View File
@@ -143,7 +143,14 @@
const previewBody = document.getElementById('previewBody');
if (!previewBody) return;
const url = '{{ share_url }}';
let url = '{{ share_url }}';
if (window.location.protocol === 'https:' && url.startsWith('http://')) {
const parsed = new URL(url);
if (parsed.host === window.location.host) {
parsed.protocol = 'https:';
url = parsed.toString();
}
}
try {
const response = await fetch(url, { method: 'GET' });
if (!response.ok) {