@@ -79,7 +79,7 @@ private async Task InvokeInternal(HttpContext context)
79
79
if ( ( HttpLoggingFields . Request & options . LoggingFields ) != HttpLoggingFields . None )
80
80
{
81
81
var request = context . Request ;
82
- var list = new List < KeyValuePair < string , string ? > > (
82
+ var list = new List < KeyValuePair < string , object ? > > (
83
83
request . Headers . Count + DefaultRequestFieldsMinusHeaders ) ;
84
84
85
85
if ( options . LoggingFields . HasFlag ( HttpLoggingFields . RequestProtocol ) )
@@ -202,20 +202,19 @@ private async Task InvokeInternal(HttpContext context)
202
202
}
203
203
}
204
204
205
- private static void AddToList ( List < KeyValuePair < string , string ? > > list , string key , string ? value )
205
+ private static void AddToList ( List < KeyValuePair < string , object ? > > list , string key , string ? value )
206
206
{
207
- list . Add ( new KeyValuePair < string , string ? > ( key , value ) ) ;
207
+ list . Add ( new KeyValuePair < string , object ? > ( key , value ) ) ;
208
208
}
209
209
210
210
public static void LogResponseHeaders ( HttpResponse response , HttpLoggingOptions options , ILogger logger )
211
211
{
212
- var list = new List < KeyValuePair < string , string ? > > (
212
+ var list = new List < KeyValuePair < string , object ? > > (
213
213
response . Headers . Count + DefaultResponseFieldsMinusHeaders ) ;
214
214
215
215
if ( options . LoggingFields . HasFlag ( HttpLoggingFields . ResponseStatusCode ) )
216
216
{
217
- list . Add ( new KeyValuePair < string , string ? > ( nameof ( response . StatusCode ) ,
218
- response . StatusCode . ToString ( CultureInfo . InvariantCulture ) ) ) ;
217
+ list . Add ( new KeyValuePair < string , object ? > ( nameof ( response . StatusCode ) , response . StatusCode ) ) ;
219
218
}
220
219
221
220
if ( options . LoggingFields . HasFlag ( HttpLoggingFields . ResponseHeaders ) )
@@ -228,7 +227,7 @@ public static void LogResponseHeaders(HttpResponse response, HttpLoggingOptions
228
227
logger . ResponseLog ( httpResponseLog ) ;
229
228
}
230
229
231
- internal static void FilterHeaders ( List < KeyValuePair < string , string ? > > keyValues ,
230
+ internal static void FilterHeaders ( List < KeyValuePair < string , object ? > > keyValues ,
232
231
IHeaderDictionary headers ,
233
232
HashSet < string > allowedHeaders )
234
233
{
@@ -237,10 +236,10 @@ internal static void FilterHeaders(List<KeyValuePair<string, string?>> keyValues
237
236
if ( ! allowedHeaders . Contains ( key ) )
238
237
{
239
238
// Key is not among the "only listed" headers.
240
- keyValues . Add ( new KeyValuePair < string , string ? > ( key , Redacted ) ) ;
239
+ keyValues . Add ( new KeyValuePair < string , object ? > ( key , Redacted ) ) ;
241
240
continue ;
242
241
}
243
- keyValues . Add ( new KeyValuePair < string , string ? > ( key , value . ToString ( ) ) ) ;
242
+ keyValues . Add ( new KeyValuePair < string , object ? > ( key , value . ToString ( ) ) ) ;
244
243
}
245
244
}
246
245
}
0 commit comments