Skip to content

Commit

Permalink
Merge pull request #65 from ombr/node-fetch-search
Browse files Browse the repository at this point in the history
Urls with query string are not working correctly. This fixes it.
  • Loading branch information
MikeKovarik authored Jun 11, 2021
2 parents f9cd3eb + dfcc18f commit 2bca265
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/polyfill/fetch-node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ if (!global.fetch) {
const httpsPromise = dynamicImport('https', https => https)

setFetch(function(url, {headers} = {}) {
let {port, hostname, pathname, protocol} = new URL(url)
let {port, hostname, pathname, protocol, search} = new URL(url)
const options = {
method: 'GET',
hostname,
path: encodeURI(pathname),
path: encodeURI(pathname) + search,
headers
}
if (port !== '') options.port = Number(port)
Expand Down

0 comments on commit 2bca265

Please sign in to comment.