Luke Pulverenti пре 8 година
родитељ
комит
982d4cbb3e
1 измењених фајлова са 4 додато и 3 уклоњено
  1. 4 3
      SocketHttpListener.Portable/Net/HttpListenerResponse.cs

+ 4 - 3
SocketHttpListener.Portable/Net/HttpListenerResponse.cs

@@ -386,7 +386,7 @@ namespace SocketHttpListener.Net
 
             if (content_type != null)
             {
-                if (content_encoding != null && content_type.IndexOf("charset=", StringComparison.Ordinal) == -1)
+                if (content_encoding != null && content_type.IndexOf("charset=", StringComparison.OrdinalIgnoreCase) == -1)
                 {
                     string enc_name = content_encoding.WebName;
                     headers.SetInternal("Content-Type", content_type + "; charset=" + enc_name);
@@ -429,9 +429,10 @@ namespace SocketHttpListener.Net
              *	HttpStatusCode.InternalServerError 	500
              *	HttpStatusCode.ServiceUnavailable 	503
              */
-            bool conn_close = (status_code == 408 || status_code == 411 ||
+            bool conn_close = status_code == 400 || status_code == 408 || status_code == 411 ||
                     status_code == 413 || status_code == 414 ||
-                    status_code == 503);
+                    status_code == 500 ||
+                    status_code == 503;
 
             if (conn_close == false)
                 conn_close = !context.Request.KeepAlive;