Skip to content

Commit 9164e2d

Browse files
committed
Merge pull request #595 from AzureAD/issues/copy-over-whitelist-fix
Copy over fix for whitelisting "about:blank"
2 parents 07b85e8 + 3a8dd64 commit 9164e2d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ADALiOS/ADALiOS/ADAuthenticationWebViewController.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
124124
}
125125

126126
NSString *requestURL = [request.URL absoluteString];
127+
128+
if ([requestURL caseInsensitiveCompare:@"about:blank"] == NSOrderedSame)
129+
{
130+
return NO;
131+
}
132+
127133
if ([[[request.URL scheme] lowercaseString] isEqualToString:@"browser"]) {
128134
_complete = YES;
129135
dispatch_async( dispatch_get_main_queue(), ^{[_delegate webAuthenticationDidCancel];});
@@ -160,7 +166,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
160166
}
161167

162168
// redirecting to non-https url is not allowed
163-
if (![requestURL hasPrefix: @"https"])
169+
if ([request.URL.scheme caseInsensitiveCompare:@"https"] != NSOrderedSame)
164170
{
165171
AD_LOG_ERROR(@"Server is redirecting to a non-https url", AD_ERROR_NON_HTTPS_REDIRECT, nil);
166172
_complete = YES;

0 commit comments

Comments
 (0)