Skip to content

Commit 9d806df

Browse files
committed
url: origin of "blob:" URL containing inner non-"http(s):" URL
Fixes #48157
1 parent d2a1f71 commit 9d806df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/internal/url.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const {
7878
} = require('internal/validators');
7979

8080
const querystring = require('querystring');
81+
const console = require('console');
8182

8283
const { platform } = process;
8384
const isWindows = platform === 'win32';
@@ -840,10 +841,13 @@ class URL {
840841
if (path.length > 0) {
841842
try {
842843
const out = new URL(path);
844+
if (out.#context.scheme_type === 0 || out.#context.scheme_type === 2) {
845+
return 'null';
846+
}
843847
if (out.#context.scheme_type !== 1) {
844848
return `${out.protocol}//${out.host}`;
845849
}
846-
} catch {
850+
} catch(e) {
847851
// Do nothing.
848852
}
849853
}

0 commit comments

Comments
 (0)