@@ -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
)
@@ -134,6 +142,10 @@ async def test_http_custom_request_headers_in_span_attributes(self):
134
142
b"non-utf8-header" ,
135
143
b"Moto Z\xb2 " ,
136
144
),
145
+ (
146
+ b"Moto-Z\xb2 -non-utf8-header-key" ,
147
+ b"Moto Z\xb2 " ,
148
+ ),
137
149
]
138
150
)
139
151
self .seed_app (self .app )
@@ -152,6 +164,7 @@ async def test_http_custom_request_headers_in_span_attributes(self):
152
164
"RegexTestValue2,RegexTestValue3" ,
153
165
),
154
166
"http.request.header.non_utf8_header" : ("Moto Z²" ,),
167
+ "http.request.header.moto_z²_non_utf8_header_key" : ("Moto Z²" ,),
155
168
"http.request.header.my_secret_header" : ("[REDACTED]" ,),
156
169
}
157
170
for span in span_list :
@@ -228,6 +241,8 @@ async def test_http_custom_response_headers_in_span_attributes(self):
228
241
"my-custom-regex-value-3,my-custom-regex-value-4" ,
229
242
),
230
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²" ,),
231
246
}
232
247
for span in span_list :
233
248
if span .kind == SpanKind .SERVER :
@@ -423,8 +438,8 @@ async def test_websocket_custom_response_headers_not_in_span_attributes(
423
438
424
439
425
440
SANITIZE_FIELDS_TEST_VALUE = ".*my-secret.*"
426
- 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"
427
- 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 "
428
443
429
444
430
445
class TestCustomHeadersEnv (TestCustomHeaders ):
0 commit comments