From bc6d15a13c32639fb207031ac8a2ccbb0d854d83 Mon Sep 17 00:00:00 2001 From: Bi11 Date: Thu, 3 Sep 2020 16:37:13 +0800 Subject: [PATCH] Support App Store URL scheme in release note webview (cherry picked from commit f2fc729b69a28ae671a947f6e2bab4131946af23) --- Sparkle/SUUpdateAlert.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 9628bb24..75e83e5f 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -479,7 +479,8 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE { NSURL *requestURL = request.URL; NSString *scheme = requestURL.scheme; - BOOL whitelistedSafe = [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [requestURL.absoluteString isEqualToString:@"about:blank"]; + BOOL isAboutBlank = [requestURL.absoluteString isEqualToString:@"about:blank"]; + BOOL whitelistedSafe = isAboutBlank || [@[@"http", @"https", @"macappstore", @"macappstores", @"itms-apps", @"itms-appss"] containsObject:scheme]; // Do not allow redirects to dangerous protocols such as file:// if (!whitelistedSafe) {