Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option for overriding HTTP-header #1231

Closed
wants to merge 2 commits into from

Conversation

AydinChavez
Copy link
Contributor

@AydinChavez AydinChavez commented Jan 23, 2018

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

Simple solution for issue: #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 ...
}

Add method parameter to options for overriding the proxy-outgoing HTTP-method
@jcrugzz
Copy link
Contributor

jcrugzz commented Apr 19, 2018

Ok, this doesn't seem harmful. Will add this to my maintenance branch @AydinChavez. Thanks for the contribution!

@jcrugzz jcrugzz closed this Apr 19, 2018
@jcrugzz
Copy link
Contributor

jcrugzz commented Apr 20, 2018

superceded by #1251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants