@@ -48,6 +48,14 @@ async def http_app_with_custom_headers(scope, receive, send):
48
48
b"my-custom-regex-value-3,my-custom-regex-value-4" ,
49
49
),
50
50
(b"my-secret-header" , b"my-secret-value" ),
51
+ (
52
+ b"non-utf8-header" ,
53
+ b"Moto Z\xb2 " ,
54
+ ),
55
+ (
56
+ b"Moto-Z\xb2 -non-utf8-header-key" ,
57
+ b"Moto Z\xb2 " ,
58
+ ),
51
59
],
52
60
}
53
61
)
@@ -130,6 +138,14 @@ async def test_http_custom_request_headers_in_span_attributes(self):
130
138
(b"Regex-Test-Header-1" , b"Regex Test Value 1" ),
131
139
(b"regex-test-header-2" , b"RegexTestValue2,RegexTestValue3" ),
132
140
(b"My-Secret-Header" , b"My Secret Value" ),
141
+ (
142
+ b"non-utf8-header" ,
143
+ b"Moto Z\xb2 " ,
144
+ ),
145
+ (
146
+ b"Moto-Z\xb2 -non-utf8-header-key" ,
147
+ b"Moto Z\xb2 " ,
148
+ ),
133
149
]
134
150
)
135
151
self .seed_app (self .app )
@@ -147,6 +163,8 @@ async def test_http_custom_request_headers_in_span_attributes(self):
147
163
"http.request.header.regex_test_header_2" : (
148
164
"RegexTestValue2,RegexTestValue3" ,
149
165
),
166
+ "http.request.header.non_utf8_header" : ("Moto Z²" ,),
167
+ "http.request.header.moto_z²_non_utf8_header_key" : ("Moto Z²" ,),
150
168
"http.request.header.my_secret_header" : ("[REDACTED]" ,),
151
169
}
152
170
for span in span_list :
@@ -223,6 +241,8 @@ async def test_http_custom_response_headers_in_span_attributes(self):
223
241
"my-custom-regex-value-3,my-custom-regex-value-4" ,
224
242
),
225
243
"http.response.header.my_secret_header" : ("[REDACTED]" ,),
244
+ "http.response.header.non_utf8_header" : ("Moto Z²" ,),
245
+ "http.response.header.moto_z²_non_utf8_header_key" : ("Moto Z²" ,),
226
246
}
227
247
for span in span_list :
228
248
if span .kind == SpanKind .SERVER :
@@ -418,8 +438,8 @@ async def test_websocket_custom_response_headers_not_in_span_attributes(
418
438
419
439
420
440
SANITIZE_FIELDS_TEST_VALUE = ".*my-secret.*"
421
- 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.*"
422
- 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.*"
441
+ 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,Moto-Z²-non-utf8-header-key "
442
+ 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.*,non-utf8-header,Moto-Z²-non-utf8-header-key "
423
443
424
444
425
445
class TestCustomHeadersEnv (TestCustomHeaders ):
0 commit comments