Skip to content

Commit 2b8bfaa

Browse files
authored
refactor: trim check for empty src and href attributes in getRequestUrl function (#12)
1 parent 75a62e0 commit 2b8bfaa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/initialChunkRetry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ function getRequestUrl(element: HTMLElement) {
4545
) {
4646
// For <script src="" /> or <img src="" />
4747
// element.getAttribute('src') === '' but element.src === baseURI
48-
if (!element.getAttribute('src')) {
48+
if (!element.getAttribute('src')?.trim()) {
4949
return null;
5050
}
5151
return element.src;
5252
}
5353
if (element instanceof HTMLLinkElement) {
5454
// For <link href="" />
55-
if (!element.getAttribute('href')) {
55+
if (!element.getAttribute('href')?.trim()) {
5656
return null;
5757
}
5858
return element.href;

0 commit comments

Comments
 (0)