Skip to content
GitLab
    • Explore Projects Groups Snippets
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 4 years ago
  • 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

Pipeline #1355 failed for 478b0ab9 on github/fork/pepmartinez/master 2 years ago
Approval is optional

Ready to merge by members who can write to the target branch.

  • 1 commit and 1 merge commit will be added to master.
  • Source branch will not be deleted.

Activity


  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: chasetec

    Don't you need to emit the proxyReq event before the pipe call? If the pipe sends the first chunk then the headers will be sent with it and won't be mutable when the proxyReq event is generated.

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: pepmartinez

    Well, all I did is to defer the pipe() until there's a socket. There were no emit() before, to start with

  • Administrator mentioned in issue #1478 3 years ago

    mentioned in issue #1478

  • Administrator restored source branch github/fork/pepmartinez/master 2 years ago

    restored source branch github/fork/pepmartinez/master

Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: http-party/node-http-proxy!1495
Source branch: github/fork/pepmartinez/master

Menu

Explore Projects Groups Snippets