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
  • !1091

add beforeProxyRequest callback config option

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/HBOCodeLabs/master into master Nov 14, 2016
  • Overview 8
  • Commits 7
  • Pipelines 0
  • Changes 3

Created by: rick-kilgore

Fix for https://github.com/nodejitsu/node-http-proxy/issues/867, and possibly these others: https://github.com/nodejitsu/node-http-proxy/issues/908, https://github.com/nodejitsu/node-http-proxy/issues/930, https://github.com/nodejitsu/node-http-proxy/issues/889, https://github.com/nodejitsu/node-http-proxy/issues/680.

This solution was suggested by @giuliopaci in https://github.com/nodejitsu/node-http-proxy/issues/867. The problem with the header re-writing example in the README is that when you do a POST, the headers are sent before the 'proxyReq' event is fired. So you really have to add the headers before calling request(). This patch allows the user to register a synchronous callback that gets called in setupOutgoing() in which the caller can setup headers, or alter the outgoing request() options in whatever way desired.

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