Skip to content

HPE_INVALID_HEADER_TOKEN on https requests #30515

Description

@ejoebstl

Version: v10.16.3
Platform: alpine:3.10 in docker
Subsystem: http_parser: '2.9.2'

HTTP request crashes with HPE_INVALID_HEADER_TOKEN.

Script to reproduce:

https.get('https://www.dezeen.com/2015/08/04/walden-raft-provides-seclusion-french-lake-elise-morin-florent-albinet-henry-david-thoreau-cabin/', (resp) => { }).on("error", (err) => {
  console.log(err);
});

Output:

{ Error: Parse Error
    at TLSSocket.socketOnData (_http_client.js:442:20)
    at TLSSocket.emit (events.js:198:13)
    at TLSSocket.EventEmitter.emit (domain.js:466:23)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:94:17) bytesParsed: 1087, code: 'HPE_INVALID_HEADER_TOKEN' }

I think it's related to http_parser: '2.9.2'. It does not happen with a slightly older build which uses http_parser: '2.8.0'.

Likely related to #27711 (comment).

The mentioned workaround does not work here, as the --http-parser option is not available on node v10.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues and PRs related to the http subsystem.http_parserIssues and PRs related to the HTTP parser implementation or http_parser binding.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions