Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N node-http-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 482
    • Issues 482
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • http ... PARTY!
  • node-http-proxy
  • Issues
  • #996
Closed
Open
Issue created Apr 26, 2016 by Administrator@rootContributor

uncaughtException when clients send non-trimmed headers

Created by: randunel

None of the error handlers are triggered when proxying client requests with non-trimmed headers.

I think the request shouldn't fail at all, but it's not up to http-proxy how node.js sanitizes the outgoing requests. At least an error that can be caught should be emitted, instead of terminating the process. Alternatively, http-proxy can sanitize the headers itself (see #997).

_http_outgoing.js:339
    throw new TypeError(
    ^

TypeError: Header name must be a valid HTTP Token ["cached-id "]
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:339:11)
    at /.../node_modules/http-proxy/lib/http-proxy/passes/web-o
utgoing.js:86:13
    at Array.forEach (native)
    at Array.writeHeaders (/.../node_modules/http-proxy/lib/htt
p-proxy/passes/web-outgoing.js:84:35)
    at ClientRequest.<anonymous> (/.../node_modules/http-proxy/
lib/http-proxy/passes/web-incoming.js:150:20)
    at emitOne (events.js:90:13)
    at ClientRequest.emit (events.js:182:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:469:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:103:23)
    at Socket.socketOnData (_http_client.js:359:20)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at TCP.onread (net.js:529:20)
Assignee
Assign to
Time tracking