fix(trace-viewer): keep searchParams on / redirect (#27956)
Relates to https://github.com/microsoft/playwright/issues/27952. Might help future users too.
This commit is contained in:
parent
a55fe8fd1f
commit
326c9785b4
|
|
@ -119,9 +119,9 @@ async function startTraceViewerServer(traceUrls: string[], options?: OpenTraceVi
|
||||||
const searchQuery = params.length ? '?' + params.join('&') : '';
|
const searchQuery = params.length ? '?' + params.join('&') : '';
|
||||||
const urlPath = `/trace/${app || 'index.html'}${searchQuery}`;
|
const urlPath = `/trace/${app || 'index.html'}${searchQuery}`;
|
||||||
|
|
||||||
server.routePath('/', (_, response) => {
|
server.routePath('/', (request, response) => {
|
||||||
response.statusCode = 302;
|
response.statusCode = 302;
|
||||||
response.setHeader('Location', urlPath);
|
response.setHeader('Location', urlPath + request.url!.substring(1));
|
||||||
response.end();
|
response.end();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue