def METHOD_NAME(self, tab):
    """Test that the CSP header is present when enabled or vice versa"""
    url = f"http://127.0.0.1:{tab.app.port}/"
    r = requests.get(url)
    QtTest.QTest.qWait(500, self.gui.qtapp)
    if tab.settings.get("website", "disable_csp"):
        self.assertFalse("Content-Security-Policy" in r.headers)
    elif tab.settings.get("website", "custom_csp"):
        self.assertEqual(tab.settings.get("website", "custom_csp"), r.headers["Content-Security-Policy"])
    else:
        self.assertEqual("default-src 'self'; frame-ancestors 'none'; form-action 'self'; base-uri 'self'; img-src 'self' data:;", r.headers["Content-Security-Policy"])