Update server/src/index.ts
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful

delete req.headers["cookie"]
This commit is contained in:
batmanisko 2025-04-11 12:06:52 +02:00
parent 9a05ef1fe6
commit 49b8ab5c13

View File

@ -55,6 +55,7 @@ app.get("/api/whoami", (req, res) => {
res.status(403).json({ error: 'Není zapnuté přihlášení z hlaviček' }); res.status(403).json({ error: 'Není zapnuté přihlášení z hlaviček' });
} }
if(process.env.ENABLE_HEADERS_LOGGING === 'yes'){ if(process.env.ENABLE_HEADERS_LOGGING === 'yes'){
delete req.headers["cookie"]
console.log(req.headers) console.log(req.headers)
} }
res.send(req.header(HTTP_REMOTE_USER_HEADER_NAME)); res.send(req.header(HTTP_REMOTE_USER_HEADER_NAME));
@ -100,8 +101,8 @@ app.use("/api/", (req, res, next) => {
if (HTTP_REMOTE_USER_ENABLED) { if (HTTP_REMOTE_USER_ENABLED) {
// Autentizace pomocí trusted headers // Autentizace pomocí trusted headers
const remoteUser = req.header(HTTP_REMOTE_USER_HEADER_NAME); const remoteUser = req.header(HTTP_REMOTE_USER_HEADER_NAME);
delete req.headers["cookie"]
if(process.env.ENABLE_HEADERS_LOGGING === 'yes'){ if(process.env.ENABLE_HEADERS_LOGGING === 'yes'){
delete req.headers["cookie"]
console.log(req.headers) console.log(req.headers)
} }
if (remoteUser && remoteUser.length > 0) { if (remoteUser && remoteUser.length > 0) {