def test_sanitize_http_headers(http_test_data): result = processors.sanitize_http_headers(None, http_test_data) expected = { 'foo': 'bar', 'password': processors.MASK, 'the_secret': processors.MASK, 'a_password_here': processors.MASK, } assert result['context']['request']['headers'] == expected assert result['context']['response']['headers'] == expected
def test_sanitize_http_headers(http_test_data): result = processors.sanitize_http_headers(None, http_test_data) expected = { "foo": "bar", "password": processors.MASK, "the_secret": processors.MASK, "a_password_here": processors.MASK, } assert result["context"]["request"]["headers"] == expected assert result["context"]["response"]["headers"] == expected
def test_sanitize_http_headers(elasticapm_client, custom_header, http_test_data): result = processors.sanitize_http_headers(elasticapm_client, http_test_data) expected = { "foo": "bar", "password": processors.MASK, "the_secret": processors.MASK, "a_password_here": processors.MASK, "authorization": processors.MASK, } expected.update(custom_header) assert result["context"]["request"]["headers"] == expected assert result["context"]["response"]["headers"] == expected