Merge pull request #832 from xplicit/webperf1
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 13 Dec 2013 15:24:06 +0000 (07:24 -0800)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 13 Dec 2013 15:24:06 +0000 (07:24 -0800)
Header names should be compared binary but not linguistic.

mcs/class/System.Web/System.Web/HttpHeaderCollection.cs
mcs/class/System.Web/System.Web/HttpResponse.cs

index 6bc6917339bfedb7f961351a97ffc89c04257c18..b015d16ef6ec45ec185052ff0e17381add7103f1 100644 (file)
@@ -34,6 +34,10 @@ namespace System.Web
        {
                bool? headerCheckingEnabled;
 
+               public HttpHeaderCollection () : base (StringComparer.OrdinalIgnoreCase)
+               {
+               }
+
                bool HeaderCheckingEnabled {
                        get {
                                if (headerCheckingEnabled == null)
index ac432ab3da3b51044b1fe2f3ce0f4561c102d5e8..053d20c9c58b9baa0a741ee35ea327dbf1a9ae48 100644 (file)
@@ -510,27 +510,27 @@ namespace System.Web
                        if (headers_sent)
                                throw new HttpException ("Headers have been already sent");
 #if !TARGET_J2EE
-                       if (String.Compare (name, "content-length", true, Helpers.InvariantCulture) == 0){
+                       if (String.Compare (name, "content-length", StringComparison.OrdinalIgnoreCase) == 0){
                                content_length = (long) UInt64.Parse (value);
                                use_chunked = false;
                                return;
                        }
 #endif
 
-                       if (String.Compare (name, "content-type", true, Helpers.InvariantCulture) == 0){
+                       if (String.Compare (name, "content-type", StringComparison.OrdinalIgnoreCase) == 0){
                                ContentType = value;
                                return;
                        }
 
 #if !TARGET_J2EE
-                       if (String.Compare (name, "transfer-encoding", true, Helpers.InvariantCulture) == 0){
+                       if (String.Compare (name, "transfer-encoding", StringComparison.OrdinalIgnoreCase) == 0){
                                transfer_encoding = value;
                                use_chunked = false;
                                return;
                        }
 #endif
 
-                       if (String.Compare (name, "cache-control", true, Helpers.InvariantCulture) == 0){
+                       if (String.Compare (name, "cache-control", StringComparison.OrdinalIgnoreCase) == 0){
                                user_cache_control = value;
                                return;
                        }