Allow access for Tailscale IPs in HTTPS enforcement

This commit is contained in:
BoShen
2026-03-11 16:21:06 +08:00
committed by GitHub
parent b08c0b7cd4
commit db8cc3026e
+1
View File
@@ -357,6 +357,7 @@ function httpsEnforcement(req, res) {
if (process.env.DASHBOARD_ALLOW_HTTP === 'true') return true;
const ip = getClientIP(req);
if (isLocalhost(ip)) return true;
if (isTailscaleIP(ip)) return true;
if (req.socket.encrypted || req.headers['x-forwarded-proto'] === 'https') return true;
setSecurityHeaders(res);
res.writeHead(403, { 'Content-Type': 'text/plain' });