also turn show-trace parameters into http urls

This commit is contained in:
Simon Knott 2024-10-29 14:05:23 +01:00
parent 4bdd5105e4
commit 9d88147b80
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -106,8 +106,16 @@ export async function installRootRedirect(server: HttpServer, traceUrls: string[
const params = new URLSearchParams();
if (path.sep !== path.posix.sep)
params.set('pathSeparator', path.sep);
for (const traceUrl of traceUrls)
for (const traceUrl of traceUrls) {
if (traceUrl.startsWith('http://') || traceUrl.startsWith('https://')) {
params.append('trace', traceUrl);
continue;
}
const url = new URL('/trace/file', server.urlPrefix('precise'));
url.searchParams.set('path', traceUrl);
params.append('trace', url.toString());
}
if (server.wsGuid())
params.append('ws', server.wsGuid()!);
if (options?.isServer)