Permalink
Browse files

Call requestRedirected after the request is actually redirected, not …

…before.
  • Loading branch information...
1 parent 4f95498 commit 3a5278fe2f5b094e6121a8a2932265dda32daccb yllan committed with Nov 18, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 Classes/ASIHTTPRequest.m
View
@@ -1466,6 +1466,7 @@ - (void)performRedirect
} else {
// Go all the way back to the beginning and build the request again, so that we can apply any new cookies
[self main];
+ [self performSelectorOnMainThread:@selector(requestRedirected) withObject:nil waitUntilDone:[NSThread isMainThread]];
}
}
@@ -2314,8 +2315,6 @@ - (BOOL)willRedirect
return NO;
}
- [self performSelectorOnMainThread:@selector(requestRedirected) withObject:nil waitUntilDone:[NSThread isMainThread]];
-
// By default, we redirect 301 and 302 response codes as GET requests
// According to RFC 2616 this is wrong, but this is what most browsers do, so it's probably what you're expecting to happen
// See also:

0 comments on commit 3a5278f

Please sign in to comment.