fix for api upload when private_society is enabled

This commit is contained in:
2026-05-23 20:34:18 +02:00
parent e0c435009b
commit b608208cf9
2 changed files with 2 additions and 2 deletions

View File

@@ -668,7 +668,7 @@ process.on('uncaughtException', err => {
// Private Society gate — require login for all content when enabled // Private Society gate — require login for all content when enabled
if (cfg.websrv.private_society && !req.session) { if (cfg.websrv.private_society && !req.session) {
const publicPaths = /^\/(s|login|logout|register|activate|forgot-password|reset-password|banned|api\/v2\/auth|manifest\.json|sw\.js|robots\.txt|favicon\.(ico|png|gif)|s\/img\/duck-icon-(192|512)\.png)(\/.*)?$/; const publicPaths = /^\/(s|login|logout|register|activate|forgot-password|reset-password|banned|api\/v2\/auth|api\/v2\/upload|manifest\.json|sw\.js|robots\.txt|favicon\.(ico|png|gif)|s\/img\/duck-icon-(192|512)\.png)(\/.*)?$/;
if (!publicPaths.test(req.url.pathname)) { if (!publicPaths.test(req.url.pathname)) {
// For AJAX requests, return 502 so it looks like the backend is down // For AJAX requests, return 502 so it looks like the backend is down
if (req.headers['x-requested-with'] === 'XMLHttpRequest') { if (req.headers['x-requested-with'] === 'XMLHttpRequest') {

View File

@@ -662,7 +662,7 @@ export const handleUpload = async (req, res, self) => {
itemid: itemid, itemid: itemid,
manual_approval: manualApproval, manual_approval: manualApproval,
redirect: !manualApproval ? `/${itemid}` : null, redirect: !manualApproval ? `/${itemid}` : null,
url: !manualApproval ? `${cfg.main.url.full}/${itemid}` : null url: !manualApproval ? `${cfg.main.url.full}/${itemid}` : `${cfg.main.url.full}/`
}); });
} catch (err) { } catch (err) {