Fixed the ' AttributeError: 'str' object has no attribute 'headers' #…
This commit is contained in:
Somdev Sangwan
2024-03-30 10:26:29 +05:30
committed by GitHub

View File

@@ -57,7 +57,7 @@ def compare(response, factors, params):
detects anomalies by comparing a HTTP response against a rule list
returns string, list (anomaly, list of parameters that caused it)
"""
if response == '':
if response == '' or type(response) == str:
return ('', [], '')
these_headers = list(response.headers.keys())
these_headers.sort()