Skip to content

Commit

Permalink
bump BSK
Browse files Browse the repository at this point in the history
  • Loading branch information
mallexxx committed Nov 28, 2024
1 parent 8cb5739 commit eb8be0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15223,7 +15223,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = revision;
revision = c82310e0352a2ab6df72c9a4d828fac2300cd46a;
revision = b65fd02ab1ca29a73286f79f9da4678bc4af1789;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "c82310e0352a2ab6df72c9a4d828fac2300cd46a"
"revision" : "b65fd02ab1ca29a73286f79f9da4678bc4af1789"
}
},
{
Expand Down
10 changes: 2 additions & 8 deletions DuckDuckGo/ErrorPage/ErrorPageHTMLFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,15 @@ enum ErrorPageHTMLFactory {
static func html(for error: WKError, featureFlagger: FeatureFlagger, header: String? = nil) -> String {
switch error as NSError {
case is MaliciousSiteError where featureFlagger.isFeatureOn(.maliciousSiteProtectionErrorPage):
return specialErrorPageTemplateHtml
return SpecialErrorPageHTMLTemplate.htmlFromTemplate

case is URLError where error.isServerCertificateUntrusted && featureFlagger.isFeatureOn(.sslCertificatesBypass):
return specialErrorPageTemplateHtml
return SpecialErrorPageHTMLTemplate.htmlFromTemplate

default:
return ErrorPageHTMLTemplate(error: WKError(_nsError: error as NSError),
header: header ?? UserText.errorPageHeader).makeHTMLFromTemplate()
}
}

public static let specialErrorPageTemplateHtml: String = {
guard let file = ContentScopeScripts.Bundle.path(forResource: "index", ofType: "html", inDirectory: "pages/special-error") else { fatalError("HTML template not found") }
guard let html = try? String(contentsOfFile: file) else { fatalError("Should be able to load template") }
return html
}()

}

0 comments on commit eb8be0b

Please sign in to comment.