-
Notifications
You must be signed in to change notification settings - Fork 5
Adding redirectURL property to store the destination of any redirect. #40
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -676,6 +676,13 @@ - (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticatio | |
|
|
||
|
|
||
| - (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response { | ||
| NSHTTPURLResponse *httpURLResponse = (NSHTTPURLResponse *)response; | ||
| if (httpURLResponse) { | ||
| if (httpURLResponse.statusCode >= kHTTPStatusMultipleChoices && httpURLResponse.statusCode < kHTTPStatusBadRequest) { | ||
| // it's a redirect | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to see: Was there a reason you chose this range? |
||
| self.redirectURL = [[httpURLResponse allHeaderFields] valueForKey:@"Location"]; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add kCumulusHTTPHeaderLocation to the list of header constants in CMConstants.h and use that instead. |
||
| } | ||
| if (response && self.authProviders.count > 0) { | ||
| NSMutableURLRequest *authorizedRequest = [request mutableCopy]; | ||
| for (id<CMAuthProvider> authProvider in self.authProviders) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test can be removed because nil.statusCode will be 0.