diff --git a/silk/model_factory.py b/silk/model_factory.py index 6a1fd180..a802beb4 100644 --- a/silk/model_factory.py +++ b/silk/model_factory.py @@ -66,20 +66,16 @@ def encoded_headers(self): """ From Django docs (https://docs.djangoproject.com/en/2.0/ref/request-response/#httprequest-objects): """ - sensitive_headers = set(SilkyConfig().SILKY_SENSITIVE_KEYS) - + sensitive_headers = set(map(str.lower, SilkyConfig().SILKY_SENSITIVE_KEYS)) sensitive_headers.add('authorization') if SilkyConfig().SILKY_HIDE_COOKIES: sensitive_headers.add('cookie') - sensitive_headers = set(map(str.lower, sensitive_headers)) - headers = {} for k, v in self.request.headers.items(): k = k.lower() if k in sensitive_headers: v = RequestModelFactory.CLEANSED_SUBSTITUTE - headers[k] = v return json.dumps(headers, cls=DefaultEncoder, ensure_ascii=SilkyConfig().SILKY_JSON_ENSURE_ASCII)