Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4784e64

Browse filesBrowse files
aduh95danielleadams
authored andcommitted
url: allow extension of user provided URL objects
PR-URL: #46989 Backport-PR-URL: #48345 Fixes: #46981 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent f495cb6 commit 4784e64
Copy full SHA for 4784e64

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎lib/internal/url.js‎

Copy file name to clipboardExpand all lines: lib/internal/url.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,9 +1170,9 @@ function urlToHttpOptions(url) {
11701170
__proto__: null,
11711171
...url, // In case the url object was extended by the user.
11721172
protocol: url.protocol,
1173-
hostname: url.hostname && StringPrototypeStartsWith(url.hostname, '[') ?
1174-
StringPrototypeSlice(url.hostname, 1, -1) :
1175-
url.hostname,
1173+
hostname: hostname && StringPrototypeStartsWith(hostname, '[') ?
1174+
StringPrototypeSlice(hostname, 1, -1) :
1175+
hostname,
11761176
hash: url.hash,
11771177
search: search,
11781178
pathname: pathname,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.