From b96a68e0de9621bac5579c73d2407a7aa1178ea1 Mon Sep 17 00:00:00 2001 From: Quentin FAYET Date: Thu, 7 Oct 2021 14:52:19 +0200 Subject: [PATCH] Fix follow_redirects doesn't work with Python 3 --- securityheaders/securityheader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/securityheaders/securityheader.py b/securityheaders/securityheader.py index 4041c64..f0fe18a 100644 --- a/securityheaders/securityheader.py +++ b/securityheaders/securityheader.py @@ -230,7 +230,7 @@ def check_headers(self, url, follow_redirects = 3, options=None): """ Follow redirect """ if (res.status >= 300 and res.status < 400 and follow_redirects > 0): for header in headers: - if (header[0] == 'location'): + if (header[0].lower() == 'location'): return self.check_headers((urlid, header[1]), follow_redirects - 1, options) """ Loop through headers and evaluate the risk """