update comparisons

This commit is contained in:
Luke Pulverenti 2016-12-22 11:48:24 -05:00
parent c2d80791be
commit 982d4cbb3e
1 changed files with 4 additions and 3 deletions

View File

@ -386,7 +386,7 @@ namespace SocketHttpListener.Net
if (content_type != null) 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; string enc_name = content_encoding.WebName;
headers.SetInternal("Content-Type", content_type + "; charset=" + enc_name); headers.SetInternal("Content-Type", content_type + "; charset=" + enc_name);
@ -429,9 +429,10 @@ namespace SocketHttpListener.Net
* HttpStatusCode.InternalServerError 500 * HttpStatusCode.InternalServerError 500
* HttpStatusCode.ServiceUnavailable 503 * 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 == 413 || status_code == 414 ||
status_code == 503); status_code == 500 ||
status_code == 503;
if (conn_close == false) if (conn_close == false)
conn_close = !context.Request.KeepAlive; conn_close = !context.Request.KeepAlive;