Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: import whatwg-url in a way compatible with ESM Node #1303

Merged
merged 2 commits into from Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,10 @@ Changelog

# 2.x release

## v2.6.5

- Fix: import `whatwg-url` in a way compatible with ESM

## v2.6.4

- Hotfix: fix v2.6.3 that did not sending query params
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "node-fetch",
"version": "2.6.4",
"version": "2.6.5",
"description": "A light-weight module that brings window.fetch to node.js",
"main": "lib/index.js",
"browser": "./browser.js",
Expand Down
3 changes: 2 additions & 1 deletion src/request.js
Expand Up @@ -9,11 +9,12 @@

import Url from 'url';
import Stream from 'stream';
import {URL} from 'whatwg-url';
import whatwgUrl from 'whatwg-url';
import Headers, { exportNodeCompatibleHeaders } from './headers.js';
import Body, { clone, extractContentType, getTotalBytes } from './body';

LinusU marked this conversation as resolved.
Show resolved Hide resolved
const INTERNALS = Symbol('Request internals');
const URL = whatwgUrl.URL;

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