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

POST 301 redirects don't respect "agent" property (when using Request library) #9

Open
jrasanen opened this issue Dec 3, 2014 · 3 comments

Comments

@jrasanen
Copy link

jrasanen commented Dec 3, 2014

When POST returns 301, the following GET isn't using the same agent setting.

var options = {
    url: 'http://website/',
    method: 'POST',
    headers: headers,
    followAllRedirects: true,
    agent: new Socks5ClientHttpAgent({socksHost: '127.0.0.1', socksPort: 9050}),
    form: {
      ...
    }
}
// POST returns 301 /index.php
request.post(options, function (err, httpResponse, body) {...});

With this example POST goes through TOR but the following GET doesn't.

@jrasanen jrasanen changed the title POST 301 redirects don't respect "agent" property POST 301 redirects don't respect "agent" property (when using Request library) Dec 3, 2014
@mattcg
Copy link
Owner

mattcg commented Dec 3, 2014

Hi, thanks for filing this. I think this looks like a bug with Request. If you try using a normal HTTP agent which you instantiate yourself do you get the same buggy behaviour?

@jrasanen
Copy link
Author

jrasanen commented Dec 4, 2014

Hi,

I filed an issue to Request too, haven't tried with normal HTTP agent yet.

@mattcg
Copy link
Owner

mattcg commented Dec 5, 2014

Thanks for filing that. I've looked at the Request code and tracked down the issue. Keeping this open until it's resolved.

Upstream issue is request/request/issues/1304 for reference.

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

No branches or pull requests

2 participants