@@ -383,8 +383,6 @@ def test_splunk_deny_list_headers_not_logged(
383383 content = payload [message_type ]
384384 assert content ["headers" ]
385385
386- headers = json .loads (content ["headers" ])
387-
388386 deny_list = [
389387 "Accept-Coding" ,
390388 "Accept-Language" ,
@@ -394,7 +392,7 @@ def test_splunk_deny_list_headers_not_logged(
394392 "Strict-Transport-Security" ,
395393 ]
396394 for denied_header in deny_list :
397- assert denied_header not in headers
395+ assert denied_header not in content [ " headers" ]
398396
399397 @pytest .mark .nhsd_apim_authorization (
400398 access = "application" , level = "level3" , force_new_token = True
@@ -464,10 +462,8 @@ def test_splunk_headers_already_logged_not_duplicated(
464462 content = payload [message_type ]
465463 assert content ["headers" ]
466464
467- headers = json .loads (content ["headers" ])
468-
469465 for logged_header in headers_already_logged :
470- assert logged_header ["header_name" ] not in headers
466+ assert logged_header ["header_name" ] not in content [ " headers" ]
471467 assert content [logged_header ["splunk_key" ]] is not None
472468
473469 @pytest .mark .nhsd_apim_authorization (
@@ -503,7 +499,7 @@ def test_splunk_request_headers_not_overwritten_in_proxy(
503499 content = splunk_payload ["request" ]
504500 assert content ["headers" ]
505501
506- headers = json . loads ( content ["headers" ])
502+ headers = content ["headers" ]
507503
508504 assert headers ["Test-Header-One" ] == "foo bar bar foo"
509505 assert headers ["Test-Header-Two" ] == "bar foo foo bar"
0 commit comments