💬 Commit message: Update 2026-02-06 20:42:32, 3 files, 3 lines
📁 Files changed: 3 📝 Lines changed: 3 • gh.png • server.ts • test.png
This commit is contained in:
+2
-1
@@ -146,6 +146,7 @@ export class BrowserServer {
|
|||||||
|
|
||||||
private setupMiddleware(): void {
|
private setupMiddleware(): void {
|
||||||
this.app.use(express.json());
|
this.app.use(express.json());
|
||||||
|
this.app.use(express.text({ type: '*/*' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
private setupRoutes(): void {
|
private setupRoutes(): void {
|
||||||
@@ -154,7 +155,7 @@ export class BrowserServer {
|
|||||||
|
|
||||||
private async handleCommand(req: Request, res: Response): Promise<void> {
|
private async handleCommand(req: Request, res: Response): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const cmd = req.body as BrowserCommand;
|
const cmd: BrowserCommand = typeof req.body === 'string' ? JSON.parse(req.body) : req.body;
|
||||||
logCommand(cmd);
|
logCommand(cmd);
|
||||||
|
|
||||||
if (cmd.cmd === 'close') {
|
if (cmd.cmd === 'close') {
|
||||||
|
|||||||
Reference in New Issue
Block a user