Skip to content

Commit 5ffea78

Browse files
committed
fix(safety): assume browsers are safe urls
1 parent 932683f commit 5ffea78

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/util/url.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ export function isUnsafeUrl(path: string): boolean {
200200
return true;
201201
}
202202

203+
// if we're in the browser, we assume that it is safe
204+
if (typeof window !== "undefined" && window.location && window.location.href) {
205+
return false;
206+
}
207+
203208
// Local/internal network addresses
204209
const localPatterns = [
205210
// Localhost variations

0 commit comments

Comments
 (0)