mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-11 20:37:54 +03:00
fix: relative url path for ui mode (#29924)
This is a follow up #29564 I did a deep dive on a redirect issue I observed in my infrastructure and originally attributed to some configuration mistakes on my part. I have code hosted on `example.com/code` and use subdomain proxying. This leads to the uimode being exposed on `example.com/code/proxy/{{port}}`. Clicking on the open uimode link shown by vscode redirected with a 302 to `example.com/proxy/{{port}}` The absolute redirect url overruled the relative path handling reverse proxies rely on. This PR turns the absolute into a relative url to avoid this issue.
This commit is contained in:
parent
7fd3539ebd
commit
437b14a903
@ -132,7 +132,7 @@ export async function installRootRedirect(server: HttpServer, traceUrls: string[
|
||||
for (const reporter of options.reporter || [])
|
||||
params.append('reporter', reporter);
|
||||
|
||||
const urlPath = `/trace/${options.webApp || 'index.html'}?${params.toString()}`;
|
||||
const urlPath = `./trace/${options.webApp || 'index.html'}?${params.toString()}`;
|
||||
server.routePath('/', (_, response) => {
|
||||
response.statusCode = 302;
|
||||
response.setHeader('Location', urlPath);
|
||||
|
Loading…
Reference in New Issue
Block a user