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

fetch seems to error on 301 response #11

Open
Gozala opened this issue Jul 20, 2021 · 0 comments
Open

fetch seems to error on 301 response #11

Gozala opened this issue Jul 20, 2021 · 0 comments

Comments

@Gozala
Copy link
Contributor

Gozala commented Jul 20, 2021

fetch(url, { method: 'POST', headers })
Promise { <pending> }
> f(node:66034) UnhandledPromiseRejectionWarning: FetchError: request to ... failed, reason: connect ENETUNREACH ...:443
    at ClientRequest.<anonymous> (file:///Users/gozala/Projects/nft.storage/node_modules/@web-std/fetch/src/index.js:100:11)
    at ClientRequest.emit (events.js:315:20)
    at ClientRequest.EventEmitter.emit (domain.js:467:12)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:315:20)
    at TLSSocket.EventEmitter.emit (domain.js:467:12)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:66034) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

Promise {
  <rejected> FetchError: request to ... failed, reason: connect ENETUNREACH ....:443
      at ClientRequest.<anonymous> (file:///Users/gozala/Projects/nft.storage/node_modules/@web-std/fetch/src/index.js:100:11)
      at ClientRequest.emit (events.js:315:20)
      at ClientRequest.EventEmitter.emit (domain.js:467:12)
      at TLSSocket.socketErrorListener (_http_client.js:469:9)
      at TLSSocket.emit (events.js:315:20)
      at TLSSocket.EventEmitter.emit (domain.js:467:12)
      at emitErrorNT (internal/streams/destroy.js:106:8)
      at emitErrorCloseNT (internal/streams/destroy.js:74:3)
      at processTicksAndRejections (internal/process/task_queues.js:80:21) {
    type: 'system',
    errno: 'ENETUNREACH',
    code: 'ENETUNREACH',
    erroredSysCall: 'connect'
  }
}

Instead request should follow a redirect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant