@@ -463,7 +463,7 @@ public static void SendFileOverHTTP(HttpListenerResponse response, string strFil
463463 long fileLength = dataReader . Length ;
464464 response . ContentType = contentType ;
465465 response . ContentLength64 = fileLength ;
466- response . SendChunked = true ;
466+ response . SendChunked = false ;
467467 // Now loops sending all the data.
468468 for ( long bytesSent = 0 ; bytesSent < fileLength ; )
469469 {
@@ -496,7 +496,7 @@ public static void SendFileOverHTTP(HttpListenerResponse response, string fileNa
496496 contentType = contentType == "" ? GetContentTypeFromFileName ( fileName . Substring ( fileName . LastIndexOf ( '.' ) + 1 ) ) : contentType ;
497497 response . ContentType = contentType ;
498498 response . ContentLength64 = content . Length ;
499- response . SendChunked = true ;
499+ response . SendChunked = false ;
500500 // Now loop to send all the data.
501501
502502 for ( long bytesSent = 0 ; bytesSent < content . Length ; )
@@ -559,7 +559,7 @@ private void StartListener()
559559 var credSite = route . Authentication . Credentials ?? Credential ;
560560 var credReq = context . Request . Credentials ;
561561
562- isAuthOk = credReq != null
562+ isAuthOk = credReq != null && credSite != null
563563 && ( credSite . UserName == credReq . UserName )
564564 && ( credSite . Password == credReq . Password ) ;
565565 }
0 commit comments