We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 413ef2f commit 940b3cdCopy full SHA for 940b3cd
lib/utils/resolve-url.js
@@ -28,9 +28,6 @@ export function resolveUrl(url, baseURI) {
28
if (url && ABS_URL.test(url)) {
29
return url;
30
}
31
- if (url === '//') {
32
- return url;
33
- }
34
// Lazy feature detection.
35
if (workingURL === undefined) {
36
workingURL = false;
@@ -46,7 +43,12 @@ export function resolveUrl(url, baseURI) {
46
43
baseURI = document.baseURI || window.location.href;
47
44
48
45
if (workingURL) {
49
- return (new URL(url, baseURI)).href;
+ try {
+ return (new URL(url, baseURI)).href;
+ } catch (e) {
+ // Bad url or baseURI structure. Do not attempt to resolve.
50
+ return url;
51
+ }
52
53
// Fallback to creating an anchor into a disconnected document.
54
if (!resolveDoc) {
0 commit comments