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

option for overriding HTTP-header

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/AydinChavez/master into master Jan 23, 2018
  • Overview 2
  • Commits 2
  • Pipelines 0
  • Changes 2

Created by: AydinChavez

Add method parameter to options for overriding the proxy-outgoing HTTP-method.

Simple solution for issue: https://github.com/nodejitsu/node-http-proxy/issues/1066

Example usage:

var server = http.createServer(function(req, res) {
  // You can define here your custom logic to handle the request
  // and then proxy the request.
  proxy.web(req, res, { target: 'http://127.0.0.1:9200', method: 'GET' });
  console.log("req: " + req);
  console.log("res: " + res);
});

You could also wrap it into a conditional statement like:

if ( req.method == "POST" ) {
   proxy.web ...
}
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/AydinChavez/master