From 74bdb1aa10dd9dac1c48679b9905fd39eac0b969 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Sun, 1 Feb 2026 22:13:12 +0000 Subject: [PATCH] Update frontend/e2e/mock-backend.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- frontend/e2e/mock-backend.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/e2e/mock-backend.js b/frontend/e2e/mock-backend.js index 01aedb2..c8f7a9d 100644 --- a/frontend/e2e/mock-backend.js +++ b/frontend/e2e/mock-backend.js @@ -88,6 +88,12 @@ const server = http.createServer((req, res) => { // Container operations const containerOpMatch = url.match(/^\/api\/containers\/([^\/]+)\/(start|stop|restart)$/); if (containerOpMatch && method === 'POST') { + const authHeader = req.headers.authorization; + if (!authHeader || !authHeader.startsWith('Bearer ')) { + res.writeHead(401, { 'Content-Type': 'application/json' }); + res.end(JSON.stringify({ error: 'Unauthorized' })); + return; + } const [, , operation] = containerOpMatch; res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({