コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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