Skip to content

Commit 0a8139d

Browse files
committed
Change logic that creates the URL prefix regexp.
1 parent a869db4 commit 0a8139d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

www/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,11 @@ <h2>Target</h2>
436436

437437
return list.map(item => {
438438
if ( ! rootRegExp && item.resourceType === 'root') {
439-
rootRegExp = new RegExp(`^${item.url}`, 'g')
439+
// @TODO: Use more intelligent logic
440+
// This works better than using the full URL
441+
// but breaks when the path has a long prefix
442+
const url = new URL(item.url)
443+
rootRegExp = new RegExp(`^${url.protocol}//${url.host}/`, 'g')
440444
}
441445

442446
if (item.size) {

0 commit comments

Comments
 (0)