Fixed the ' AttributeError: 'str' object has no attribute 'headers' #204 ' Issue

This commit is contained in:
Gaurav Raj
2024-03-17 11:04:05 +05:30
parent cb2f067715
commit 5b6ea26519

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()