Add Server header, connection close and urldecode on get params

This commit is contained in:
Mike Nolan
2022-06-22 15:03:20 -05:00
parent 68bf4deb21
commit 340c8ae946
3 changed files with 8 additions and 5 deletions
@@ -70,7 +70,7 @@ namespace Tesses.WebServer
{
//ctx.StatusCode = 200;
int start = 0, end = (int)strm.Length - 1;
if (ctx.RequestHeaders.ContainsKey(BYTES_RANGE_HEADER))
if (ctx.RequestHeaders.ContainsKey(BYTES_RANGE_HEADER) && strm.CanSeek)
{
if (ctx.RequestHeaders[BYTES_RANGE_HEADER].Count > 1)
{
@@ -100,6 +100,7 @@ namespace Tesses.WebServer
{
try
{
if(strm.CanSeek)
strm.Position = start;
strm.CopyTo(ctx.NetworkStream, Math.Min(8 * 1024 * 1024, end - start + 1));
}