Skip to content

Commit 5559b7d

Browse files
committed
use url object to prevent parsing issues
1 parent 2cbfbc2 commit 5559b7d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

report-viewer/report-viewer/src/stores/fileLoading.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export async function loadReport(): Promise<void> {
1212
reportFile = await getLocalFile('example.jplag')
1313
reportName = 'progpedia.jplag'
1414
} else if (getQueryFileUrl() !== null) {
15-
const queryURL = getQueryFileUrl()!
16-
const response = await fetch(new URL(queryURL))
15+
const queryURL = new URL(getQueryFileUrl()!)
16+
const response = await fetch(queryURL)
1717
reportFile = await response.blob()
1818

19-
const urlParts = queryURL.split('/')
19+
const urlParts = queryURL.pathname.split('/')
2020
const lastUrlPart = urlParts[urlParts.length - 1]
2121
if (lastUrlPart?.endsWith('.jplag')) {
2222
reportName = lastUrlPart

0 commit comments

Comments
 (0)