Skip to content

Commit

Permalink
Fix: infinite loop during redirect parsing (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo authored Apr 16, 2023
1 parent f792fe1 commit 19bea1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ self.addEventListener('fetch', event => {
const referrerParts = request.referrer.split('/')
const newParts: string[] = []
let index = 0
while (destinationParts[index] === referrerParts[index]) {
while (destinationParts[index] === referrerParts[index] && index < destinationParts.length && index < referrerParts.length) {
newParts.push(destinationParts[index])
index++
}
Expand Down

0 comments on commit 19bea1c

Please sign in to comment.