Skip to content

Commit f3be3a6

Browse files
authored
Refactor use of deprecated url.resolve
1 parent d16bd2f commit f3be3a6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* All spec algorithm step numbers are based on https://fetch.spec.whatwg.org/commit-snapshots/ae716822cb3a61843226cd090eefc6589446c1d2/.
88
*/
99

10-
import { resolve as resolve_url } from 'url';
1110
import http from 'http';
1211
import https from 'https';
1312
import zlib from 'zlib';
@@ -71,7 +70,7 @@ export default function fetch(url, opts) {
7170
const location = headers.get('Location');
7271

7372
// HTTP fetch step 5.3
74-
const locationURL = location === null ? null : resolve_url(request.url, location);
73+
const locationURL = location === null ? null : new URL(location, request.url).toString();
7574

7675
// HTTP fetch step 5.5
7776
switch (request.redirect) {

0 commit comments

Comments
 (0)