From 95f4b700477fb76a4a5dab34699e260fa9b43734 Mon Sep 17 00:00:00 2001 From: santoru Date: Fri, 17 May 2024 14:58:28 +0200 Subject: [PATCH] Fix case --- shcheck/shcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shcheck/shcheck.py b/shcheck/shcheck.py index db9bd81..93fcac9 100755 --- a/shcheck/shcheck.py +++ b/shcheck/shcheck.py @@ -321,7 +321,7 @@ def main(): json_results["missing"] = [] # Before parsing, remove X-Frame-Options if there's CSP with frame-ancestors directive - if "Content-Security-Policy".lower() in str(headers).lower() and "frame-ancestors" in headers.get('Content-Security-Policy'.lower()).lower(): + if "content-security-policy" in headers.keys() and "frame-ancestors" in headers.get("content-security-policy").lower(): sec_headers.pop("X-Frame-Options", None) headers.pop("X-Frame-Options".lower(), None)