mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-26 16:42:27 +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) {
|
if (options.port) {
|
||||||
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) => {
|
||||||
const url = new URL(req.url ?? '', `http://${req.headers.host}`);
|
|
||||||
if (req.method === 'POST') {
|
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) {
|
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