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 b5417ae

Browse filesBrowse files
authored
fix: import whatwg-url in a way compatible with ESM Node (#1303)
* fix: import whatwg-url in a way compatible with ESM Node * release: 2.6.5
1 parent 18193c5 commit b5417ae
Copy full SHA for b5417ae

File tree

Expand file treeCollapse file tree

3 files changed

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

3 files changed

+7
-2
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ Changelog
55

66
# 2.x release
77

8+
## v2.6.5
9+
10+
- Fix: import `whatwg-url` in a way compatible with ESM
11+
812
## v2.6.4
913

1014
- Hotfix: fix v2.6.3 that did not sending query params

‎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.4",
3+
"version": "2.6.5",
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
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010
import Url from 'url';
1111
import Stream from 'stream';
12-
import {URL} from 'whatwg-url';
12+
import whatwgUrl from 'whatwg-url';
1313
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;
1718

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

0 commit comments

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