Skip to content

http_server handles headersTimeout and requestTimeout checking wrong #43355

Closed
@emilfihlman

Description

@emilfihlman

Version

master

Platform

any

Subsystem

http

What steps will reproduce the bug?

Attempt to create http.createServer with options that include requestTimeout and headersTimeout that are set the same and > 0

How often does it reproduce? Is there a required condition?

When creating http server with requestTimeout and headersTimeout set appropriately.

What is the expected behavior?

http server creation should succeed

What do you see instead?

node:_http_server:389
    throw new codes.ERR_OUT_OF_RANGE('headersTimeout', '>= requestTimeout', headersTimeout);
    ^

RangeError [ERR_OUT_OF_RANGE]: The value of "headersTimeout" is out of range. It must be >= requestTimeout. Received 1000
    at new NodeError (node:internal/errors:377:5)
    at Server.storeHTTPOptions (node:_http_server:389:11)
    at new Server (node:_http_server:431:20)
    at Object.createServer (node:http:59:10)
    at main ...
  code: 'ERR_OUT_OF_RANGE'
}

Node.js v18.2.0

Additional information

#43354

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions