add newlines
This commit is contained in:
parent
592f7cc2e3
commit
d3e9656872
|
|
@ -147,11 +147,13 @@ function formatUrl(trace: string, server: TraceViewerServerBackend) {
|
||||||
|
|
||||||
export class TraceViewerServerBackend {
|
export class TraceViewerServerBackend {
|
||||||
constructor(private readonly baseUrl: string) {}
|
constructor(private readonly baseUrl: string) {}
|
||||||
|
|
||||||
getFileURL(path: string): URL {
|
getFileURL(path: string): URL {
|
||||||
const url = new URL('trace/file', this.baseUrl);
|
const url = new URL('trace/file', this.baseUrl);
|
||||||
url.searchParams.set('path', path);
|
url.searchParams.set('path', path);
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
async readFile(path: string): Promise<Response | undefined> {
|
async readFile(path: string): Promise<Response | undefined> {
|
||||||
const response = await fetch(this.getFileURL(path));
|
const response = await fetch(this.getFileURL(path));
|
||||||
if (response.status === 404)
|
if (response.status === 404)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue