Skip to content

Timeout not thrown with wrong https url, port, http2 enabled #1492

@asomethings

Description

@asomethings

Describe the bug

  • Node.js version: v12.18.3 / v14.13.0
  • OS & version: Ubuntu 20.04.1 LTS / x86-64
  • Got version: v11.7.0

Request to a url which starts with https, url with port ends up with pending forever.
Since timeout error is thrown well with https, wrong url, http2 enabled, I think it should throw timeout error instead of pending forever with https, wrong url, port, http2 enabled too.
Also i acknowledge that using https with port is an rare use case but still i think it should behave the same as others.

Actual behavior

Promise pends forever.

Expected behavior

Below error should be thrown after 500ms

RequestError: Timeout awaiting 'request' for 500ms

Code to reproduce

got('https://www.example.com:8800', {
  method: 'POST',
  http2: true,
  responseType: 'buffer',
  timeout: 500,
  retry: {
    limit: 0,
  },
})

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething does not work as it shouldexternalThe issue related to an external project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions