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 f56b0c6

Browse filesBrowse files
authored
fix(URL): prefer built in URL version when available and fallback to whatwg (#1352)
* fix(URL): prefer built in URL version when available and fallback to whatwg * bump minor
1 parent b5417ae commit f56b0c6
Copy full SHA for f56b0c6

File tree

Expand file treeCollapse file tree

3 files changed

+9
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-2
lines changed

‎package.json

Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-fetch",
3-
"version": "2.6.5",
3+
"version": "2.6.6",
44
"description": "A light-weight module that brings window.fetch to node.js",
55
"main": "lib/index.js",
66
"browser": "./browser.js",

‎src/request.js

Copy file name to clipboardExpand all lines: src/request.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Headers, { exportNodeCompatibleHeaders } from './headers.js';
1414
import Body, { clone, extractContentType, getTotalBytes } from './body';
1515

1616
const INTERNALS = Symbol('Request internals');
17-
const URL = whatwgUrl.URL;
17+
const URL = Url.URL || whatwgUrl.URL;
1818

1919
// fix an issue where "format", "parse" aren't a named export for node <10
2020
const parse_url = Url.parse;

‎test/test.js

Copy file name to clipboardExpand all lines: test/test.js
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,4 +2875,11 @@ describe('issue #1290', function() {
28752875
});
28762876
});
28772877
});
2878+
2879+
// #1342
2880+
it('should not throw with a valid URL', () => {
2881+
const url = 'https://r2---sn-n4v7sney.example.com';
2882+
new Request(url);
2883+
});
2884+
28782885
});

0 commit comments

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