Skip to content

Commit

Permalink
fix: import whatwg-url in a way compatible with ESM Node
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusU committed Sep 21, 2021
1 parent 18193c5 commit a3d8a98
Showing 1 changed file with 2 additions and 1 deletion.
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';

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

0 comments on commit a3d8a98

Please sign in to comment.