title: Swift - Alert says website is blocked when trying to access a page that should be allowed
body: <p>I have this code, which is supposed to block the user from visiting websites that are not safe by checking their host:</p>
  <pre><code>    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -&gt; Void) {
          let url = navigationAction.request.url
          
          if let host = url?.host {
              for website in websites {
                  if host.contains(website) {
                      decisionHandler(.allow)
                      return
                  }
              }
          }
          
          decisionHandler(.cancel)
          
          let ac = UIAlertController(title: &quot;The website you are trying to visiting is not allowed&quot;, message: nil, preferredStyle: .alert)
          ac.addAction(UIAlertAction(title: &quot;Cancel&quot;, style: .cancel))
          present(ac, animated: true)
      }
  </code></pre>
  <p>However, whenever I open any website on my list, the alert pops over, as if the website is not safe.</p>
  <p>Here is my websites string:</p>
  <pre><code>var websites = [&quot;smithsonianmag.com&quot;, &quot;bigthink.com&quot;, &quot;theonion.com&quot;, &quot;oddee.com&quot;, &quot;apartmenttherapy.com&quot;, &quot;coolthings.com&quot;]
  </code></pre>
  <p>I tried the following on Playgrounds to try and understand if there was a problem with the websites I have</p>
  <pre><code>import UIKit
  import WebKit
  
  var websites = [&quot;smithsonianmag.com&quot;, &quot;bigthink.com&quot;, &quot;theonion.com&quot;, &quot;oddee.com&quot;, &quot;apartmenttherapy.com&quot;, &quot;coolthings.com&quot;]
  
  for website in websites {
      let url = URL(string: &quot;https://&quot; + website)
      let host = url?.host
      print(&quot;host:&quot; + host!)
  }
  </code></pre>
  <p>but it seemed fine, as the outputs were the following:</p>
  <pre><code>host:smithsonianmag.com
  host:bigthink.com
  host:theonion.com
  host:oddee.com
  host:apartmenttherapy.com
  host:coolthings.com
  </code></pre>
  <p>What am I doing wrong with my code or even with the Playgrounds check?</p>