master #22

Merged
kibi merged 3 commits from master into 98 2026-07-26 20:23:11 +00:00
4 changed files with 22 additions and 0 deletions
Showing only changes of commit a3148848f2 - Show all commits

View File

@@ -5,6 +5,7 @@
"domain": "example.com",
"regex": "example\\.com"
},
"onion": "http://your-onion-address.onion",
"socks": "socks5://127.0.0.1:9050",
"mail": "admin@example.com",
"maxfilesize": 104857600,

View File

@@ -456,6 +456,15 @@ process.on('uncaughtException', err => {
res.setHeader('Permissions-Policy', 'geolocation=(), microphone=(), camera=()');
// Encourage connection reuse — helps external tools like ShareX avoid repeated TCP/TLS handshakes
res.setHeader('Connection', 'keep-alive');
// Tor Onion-Location header: advertises .onion service counterpart to Tor Browser users
if (cfg.main.onion && !req.headers['host']?.endsWith('.onion')) {
const p = req.url?.pathname || '/';
const s = req.url?.search || '';
const onionHost = cfg.main.onion.replace(/\/+$/, '');
res.setHeader('Onion-Location', `${onionHost}${p}${s}`);
}
if (isSecure) {
res.setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains');
}