@@ -463,7 +463,7 @@ public static void SendFileOverHTTP(HttpListenerResponse response, string strFil
463
463
long fileLength = dataReader . Length ;
464
464
response . ContentType = contentType ;
465
465
response . ContentLength64 = fileLength ;
466
- response . SendChunked = true ;
466
+ response . SendChunked = false ;
467
467
// Now loops sending all the data.
468
468
for ( long bytesSent = 0 ; bytesSent < fileLength ; )
469
469
{
@@ -496,7 +496,7 @@ public static void SendFileOverHTTP(HttpListenerResponse response, string fileNa
496
496
contentType = contentType == "" ? GetContentTypeFromFileName ( fileName . Substring ( fileName . LastIndexOf ( '.' ) + 1 ) ) : contentType ;
497
497
response . ContentType = contentType ;
498
498
response . ContentLength64 = content . Length ;
499
- response . SendChunked = true ;
499
+ response . SendChunked = false ;
500
500
// Now loop to send all the data.
501
501
502
502
for ( long bytesSent = 0 ; bytesSent < content . Length ; )
@@ -559,7 +559,7 @@ private void StartListener()
559
559
var credSite = route . Authentication . Credentials ?? Credential ;
560
560
var credReq = context . Request . Credentials ;
561
561
562
- isAuthOk = credReq != null
562
+ isAuthOk = credReq != null && credSite != null
563
563
&& ( credSite . UserName == credReq . UserName )
564
564
&& ( credSite . Password == credReq . Password ) ;
565
565
}
0 commit comments