Skip to content

Commit

Permalink
[focus-ios] Refactor FXIOS-7772 [v123] Added url check for server sid…
Browse files Browse the repository at this point in the history
  • Loading branch information
nbhasin2 authored Jan 17, 2024
1 parent 6c9f949 commit 9d19795
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,16 @@ extension WebViewController: UIScrollViewDelegate {
}

extension WebViewController: WKNavigationDelegate {
func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) {
// validate the URL using URIFixup
guard let urlString = webView.url?.absoluteString,
URIFixup.getURL(entry: urlString) != nil else {
// URL failed validation, prevent loading
stop()
return
}
}

func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
delegate?.webControllerDidStartNavigation(self)
trackingProtectionManager.trackingProtectionStatus.trackingInformation = TPPageStats()
Expand Down

0 comments on commit 9d19795

Please sign in to comment.