mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-27 00:52:27 +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 sessions = new Map<string, SSEServerTransport>();
|
||||||
const httpServer = http.createServer(async (req, res) => {
|
const httpServer = http.createServer(async (req, res) => {
|
||||||
if (req.method === 'POST') {
|
if (req.method === 'POST') {
|
||||||
const host = req.headers.host ?? 'http://unknown';
|
const searchParams = new URL(`http://localhost${req.url}`).searchParams;
|
||||||
const sessionId = new URL(host + req.url!).searchParams.get('sessionId');
|
const sessionId = searchParams.get('sessionId');
|
||||||
if (!sessionId) {
|
if (!sessionId) {
|
||||||
res.statusCode = 400;
|
res.statusCode = 400;
|
||||||
res.end('Missing sessionId');
|
res.end('Missing sessionId');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user