@@ -1056,7 +1056,7 @@ private void ParseSection(RebufferableBinaryReader reader)
10561056 // in the case of single file uploads. Multi-file uploads have Content-Disposition: file according
10571057 // to the spec however in practise it seems that multiple files will be represented by
10581058 // multiple Content-Disposition: form-data files.
1059- var parameters = new Dictionary < string , string > ( ) ;
1059+ var parameters = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
10601060
10611061 string line = reader . ReadLine ( ) ;
10621062 while ( line != string . Empty )
@@ -1091,8 +1091,9 @@ private void ParseSection(RebufferableBinaryReader reader)
10911091
10921092 // Limit split to 2 splits so we don't accidently split characters in file paths.
10931093 . ToDictionary (
1094- x => x [ 0 ] . Trim ( ) . Replace ( "\" " , string . Empty ) . ToLower ( ) ,
1095- x => x [ 1 ] . Trim ( ) . Replace ( "\" " , string . Empty ) ) ;
1094+ x => x [ 0 ] . Trim ( ) . Replace ( "\" " , string . Empty ) ,
1095+ x => x [ 1 ] . Trim ( ) . Replace ( "\" " , string . Empty ) ,
1096+ StringComparer . OrdinalIgnoreCase ) ;
10961097
10971098 // Here we just want to push all the values that we just retrieved into the
10981099 // parameters dictionary.
@@ -1155,7 +1156,7 @@ private async Task ParseSectionAsync(RebufferableBinaryReader reader, Cancellati
11551156 // in the case of single file uploads. Multi-file uploads have Content-Disposition: file according
11561157 // to the spec however in practise it seems that multiple files will be represented by
11571158 // multiple Content-Disposition: form-data files.
1158- var parameters = new Dictionary < string , string > ( ) ;
1159+ var parameters = new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
11591160
11601161 string line = await reader . ReadLineAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
11611162 while ( line != string . Empty )
@@ -1190,8 +1191,9 @@ private async Task ParseSectionAsync(RebufferableBinaryReader reader, Cancellati
11901191
11911192 // Limit split to 2 splits so we don't accidently split characters in file paths.
11921193 . ToDictionary (
1193- x => x [ 0 ] . Trim ( ) . Replace ( "\" " , string . Empty ) . ToLower ( ) ,
1194- x => x [ 1 ] . Trim ( ) . Replace ( "\" " , string . Empty ) ) ;
1194+ x => x [ 0 ] . Trim ( ) . Replace ( "\" " , string . Empty ) ,
1195+ x => x [ 1 ] . Trim ( ) . Replace ( "\" " , string . Empty ) ,
1196+ StringComparer . OrdinalIgnoreCase ) ;
11951197
11961198 // Here we just want to push all the values that we just retrieved into the
11971199 // parameters dictionary.
@@ -1273,8 +1275,11 @@ private IDictionary<string, string> GetAdditionalParameters(IDictionary<string,
12731275 {
12741276 var wellKnownParameters = new [ ] { "name" , "filename" , "content-type" , "content-disposition" } ;
12751277 var additionalParameters = parameters
1276- . Where ( param => ! wellKnownParameters . Contains ( param . Key ) )
1277- . ToDictionary ( x => x . Key , x => x . Value ) ;
1278+ . Where ( param => ! wellKnownParameters . Contains ( param . Key , StringComparer . OrdinalIgnoreCase ) )
1279+ . ToDictionary (
1280+ x => x . Key ,
1281+ x => x . Value ,
1282+ StringComparer . OrdinalIgnoreCase ) ;
12781283 return additionalParameters ;
12791284 }
12801285
0 commit comments