mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-26 08:32:26 +08:00
Revert "fix: tired URL parsing bug" (#77)
Reverts microsoft/playwright-mcp#70 I was working on a bigger change and this conflicts.
This commit is contained in:
parent
edac6da891
commit
889af3c853
@ -54,9 +54,9 @@ program
|
||||
if (options.port) {
|
||||
const sessions = new Map<string, SSEServerTransport>();
|
||||
const httpServer = http.createServer(async (req, res) => {
|
||||
const url = new URL(req.url ?? '', `http://${req.headers.host}`);
|
||||
if (req.method === 'POST') {
|
||||
const sessionId = url.searchParams.get('sessionId');
|
||||
const host = req.headers.host ?? 'http://unknown';
|
||||
const sessionId = new URL(host + req.url!).searchParams.get('sessionId');
|
||||
if (!sessionId) {
|
||||
res.statusCode = 400;
|
||||
res.end('Missing sessionId');
|
||||
|
Loading…
x
Reference in New Issue
Block a user