master #22
@@ -5,6 +5,7 @@
|
|||||||
"domain": "example.com",
|
"domain": "example.com",
|
||||||
"regex": "example\\.com"
|
"regex": "example\\.com"
|
||||||
},
|
},
|
||||||
|
"onion": "http://your-onion-address.onion",
|
||||||
"socks": "socks5://127.0.0.1:9050",
|
"socks": "socks5://127.0.0.1:9050",
|
||||||
"mail": "admin@example.com",
|
"mail": "admin@example.com",
|
||||||
"maxfilesize": 104857600,
|
"maxfilesize": 104857600,
|
||||||
|
|||||||
@@ -456,6 +456,15 @@ process.on('uncaughtException', err => {
|
|||||||
res.setHeader('Permissions-Policy', 'geolocation=(), microphone=(), camera=()');
|
res.setHeader('Permissions-Policy', 'geolocation=(), microphone=(), camera=()');
|
||||||
// Encourage connection reuse — helps external tools like ShareX avoid repeated TCP/TLS handshakes
|
// Encourage connection reuse — helps external tools like ShareX avoid repeated TCP/TLS handshakes
|
||||||
res.setHeader('Connection', 'keep-alive');
|
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) {
|
if (isSecure) {
|
||||||
res.setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains');
|
res.setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user