mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-26 08:32:26 +08:00
chore: parse search params the usual way (#78)
This commit is contained in:
parent
7bda082a4e
commit
195ed4a4ba
@ -89,8 +89,8 @@ async function startSSEServer(port: number, serverList: ServerList) {
|
||||
const sessions = new Map<string, SSEServerTransport>();
|
||||
const httpServer = http.createServer(async (req, res) => {
|
||||
if (req.method === 'POST') {
|
||||
const host = req.headers.host ?? 'http://unknown';
|
||||
const sessionId = new URL(host + req.url!).searchParams.get('sessionId');
|
||||
const searchParams = new URL(`http://localhost${req.url}`).searchParams;
|
||||
const sessionId = searchParams.get('sessionId');
|
||||
if (!sessionId) {
|
||||
res.statusCode = 400;
|
||||
res.end('Missing sessionId');
|
||||
|
Loading…
x
Reference in New Issue
Block a user