Skip to content

Commit

Permalink
fix: url is string type (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
specialCoder committed Jun 16, 2023
1 parent db81050 commit 31a8ff9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion load-image.js
Expand Up @@ -61,7 +61,7 @@ function makeRequest(url, resolve, reject, redirectCount, requestOptions) {
const lib = isHttps ? (!https ? (https = require('https')) : https) : !http ? (http = require('http')) : http

lib
.get(url, requestOptions || {}, (res) => {
.get(url.toString(), requestOptions || {}, (res) => {
const shouldRedirect = REDIRECT_STATUSES.has(res.statusCode) && typeof res.headers.location === 'string'
if (shouldRedirect && redirectCount > 0)
return makeRequest(new URL(res.headers.location), resolve, reject, redirectCount - 1, requestOptions)
Expand Down

0 comments on commit 31a8ff9

Please sign in to comment.