Update frontend/e2e/mock-backend.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-01 22:13:12 +00:00
committed by GitHub
parent 5b4d971390
commit 74bdb1aa10

View File

@@ -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({