Skip to content

Commit

Permalink
add unit test for non-utf8 header decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky-ken committed Sep 11, 2024
1 parent 4d596a2 commit 61dd28c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ async def test_http_custom_request_headers_in_span_attributes(self):
(b"Regex-Test-Header-1", b"Regex Test Value 1"),
(b"regex-test-header-2", b"RegexTestValue2,RegexTestValue3"),
(b"My-Secret-Header", b"My Secret Value"),
(
b"non-utf8-header",
b"Moto Z\xb2",
),
]
)
self.seed_app(self.app)
Expand All @@ -147,6 +151,7 @@ async def test_http_custom_request_headers_in_span_attributes(self):
"http.request.header.regex_test_header_2": (
"RegexTestValue2,RegexTestValue3",
),
"http.request.header.non_utf8_header": ("Moto Z²",),
"http.request.header.my_secret_header": ("[REDACTED]",),
}
for span in span_list:
Expand Down Expand Up @@ -418,7 +423,7 @@ async def test_websocket_custom_response_headers_not_in_span_attributes(


SANITIZE_FIELDS_TEST_VALUE = ".*my-secret.*"
SERVER_REQUEST_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*"
SERVER_REQUEST_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,Regex-Test-Header-.*,Regex-Invalid-Test-Header-.*,.*my-secret.*,non-utf8-header"
SERVER_RESPONSE_TEST_VALUE = "Custom-Test-Header-1,Custom-Test-Header-2,Custom-Test-Header-3,my-custom-regex-header-.*,invalid-regex-header-.*,.*my-secret.*"


Expand Down

0 comments on commit 61dd28c

Please sign in to comment.