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

Fix redirections #564

Merged
merged 1 commit into from
May 31, 2013
Merged

Fix redirections #564

merged 1 commit into from
May 31, 2013

Conversation

criloz
Copy link
Contributor

@criloz criloz commented May 31, 2013

The problem

Request module was ignoring the new location

Why:

when there are a new redirection self.uri is set to the new location

self.uri = url.parse(redirectTo)

after that again , call the init function with this

if (self.url ) {
    // People use this property instead all the time so why not just support it.
    self.uri = self.url
    delete self.url
  }

so the location is ignored, have not effect, and the second request is done to the original url

solution

if (self.url && !self.uri) {
    // People use this property instead all the time so why not just support it.
    self.uri = self.url
    delete self.url
  }

Regards

they were having no effect, the module was ignoring the new location
mikeal added a commit that referenced this pull request May 31, 2013
@mikeal mikeal merged commit 7f4781f into request:master May 31, 2013
@mikeal
Copy link
Member

mikeal commented May 31, 2013

great bug, can't believe we just now found it. thanks for the fix :)

@criloz
Copy link
Contributor Author

criloz commented May 31, 2013

👍

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