From 610ed7e94486258e7dbd82730c668511eb3e87fc Mon Sep 17 00:00:00 2001 From: Harald Wolff Date: Thu, 24 Dec 2020 15:10:06 +0100 Subject: [PATCH] Fix bug in StaticRouter, open files with ReadOnly access --- ln.http/ln.http.csproj | 2 +- ln.http/router/StaticRouter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ln.http/ln.http.csproj b/ln.http/ln.http.csproj index 8ce1466..ecb1285 100644 --- a/ln.http/ln.http.csproj +++ b/ln.http/ln.http.csproj @@ -3,7 +3,7 @@ netcoreapp3.1 true - 0.4.0 + 0.4.1 Harald Wolff-Thobaben l--n.de diff --git a/ln.http/router/StaticRouter.cs b/ln.http/router/StaticRouter.cs index d2b1b4a..01ab456 100644 --- a/ln.http/router/StaticRouter.cs +++ b/ln.http/router/StaticRouter.cs @@ -55,7 +55,7 @@ namespace ln.http.router { lock (this) { - HttpResponse httpResponse = new HttpResponse(httpRequest, new FileStream(finalPath, FileMode.Open)); + HttpResponse httpResponse = new HttpResponse(httpRequest, new FileStream(finalPath, FileMode.Open, FileAccess.Read)); httpResponse.SetHeader("content-type", MimeTypeMap.GetMimeType(Path.GetExtension(finalPath))); return httpResponse; }