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
  • Merge requests
  • !1495

do not pipe req into proxyReq until socket is connected

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/pepmartinez/master into master Dec 23, 2020
  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 1

Created by: pepmartinez

While building a reverse proxy with ha-lb capabilities I found out that proxy.web() does not play totally well with retries if a request body is present: it turns out the original req is piped into the proxyReq immediately, even before the socket at proxyReq tries to connect; such piping would read some (or even all) of the original req's body even if the socket does not connect; those body bytes would be lost if we choose to proxy.web() the same request onto an alternative target

The patch delays the piping until proxyReq's socket is present, and it's either connected (that is, reused from an agent) or suceeds to connect

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pepmartinez/master