stuck in redirect loop #24

Closed
demian85 opened this Issue Apr 20, 2011 · 3 comments

Comments

Projects
None yet
2 participants

browser loads just fine.. but this simple code prints an empty body, and if i don't set option "followRedirect", a warning comes up saying "probably stuck in redirect loop..."

    var util = require('util'),
    request = require('request');

request({uri: 'http://muyboca.com.ar/feed', followRedirect: false}, function(err, response, body) {
    console.log(body)
});
Owner

mikeal commented Apr 20, 2011

I think that page wants some kind of cookie or else it redirects back to itself over and over again.

I tested this with curl and it definitely is a redirect loop.

The reason it prints nothing for the body is because you callback is called on the 302 redirect response from the server which has no body.

You probably need some kind of auth information or cookie in order to request this resource properly.

@mikeal mikeal closed this Apr 20, 2011

What kind of header do i need to send to avoid that redirect? browser works
just fine even if i enter for the first time, that's weird...

On Wed, Apr 20, 2011 at 7:12 PM, mikeal <
reply@reply.github.com>wrote:

I think that page wants some kind of cookie or else it redirects back to
itself over and over again.

I tested this with curl and it definitely is a redirect loop.

The reason it prints nothing for the body is because you callback is called
on the 302 redirect response from the server which has no body.

You probably need some kind of auth information or cookie in order to
request this resource properly.

Reply to this email directly or view it on GitHub:
mikeal#24 (comment)

Owner

mikeal commented Apr 20, 2011

the browser is either already auth'd or one of those pages set a cookie in the forward request that the other page needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment