diff --git a/src/Unosquare.Labs.EmbedIO/Modules/StaticFilesModule.cs b/src/Unosquare.Labs.EmbedIO/Modules/StaticFilesModule.cs index 3c816b110..ef916c24f 100644 --- a/src/Unosquare.Labs.EmbedIO/Modules/StaticFilesModule.cs +++ b/src/Unosquare.Labs.EmbedIO/Modules/StaticFilesModule.cs @@ -436,7 +436,7 @@ private static bool CalculateRange(string partialHeader, long fileSize, out int string.IsNullOrWhiteSpace(range[1])) || (range.Length == 1 && int.TryParse(range[0], out lowerByteIndex))) { - upperByteIndex = (int) fileSize - 1; + upperByteIndex = (int) fileSize; return true; } @@ -444,7 +444,7 @@ private static bool CalculateRange(string partialHeader, long fileSize, out int int.TryParse(range[1], out upperByteIndex)) { lowerByteIndex = (int) fileSize - upperByteIndex; - upperByteIndex = (int) fileSize - 1; + upperByteIndex = (int) fileSize; return true; } diff --git a/src/Unosquare.Labs.EmbedIO/project.json b/src/Unosquare.Labs.EmbedIO/project.json index 608b64eba..1082f6f8e 100644 --- a/src/Unosquare.Labs.EmbedIO/project.json +++ b/src/Unosquare.Labs.EmbedIO/project.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-*", + "version": "1.2.3-*", "buildOptions": { "xmlDoc": true }, diff --git a/test/Unosquare.Labs.EmbedIO.Tests/StaticFilesModuleTest.cs b/test/Unosquare.Labs.EmbedIO.Tests/StaticFilesModuleTest.cs index 33ffce579..b720228e8 100644 --- a/test/Unosquare.Labs.EmbedIO.Tests/StaticFilesModuleTest.cs +++ b/test/Unosquare.Labs.EmbedIO.Tests/StaticFilesModuleTest.cs @@ -338,13 +338,13 @@ public async Task FileWritable() using (var server = new WebServer(endpoint, Logger)) { - server.RegisterModule(new StaticFilesModule(root)); + server.RegisterModule(new StaticFilesModule(root) { UseRamCache = false }); var serverTask = server.RunAsync(); var webClient = new HttpClient(); var remoteFile = await webClient.GetStringAsync(endpoint); File.WriteAllText(file, Resources.SubIndex); - await Task.Delay(100); + var remoteUpdatedFile = await webClient.GetStringAsync(endpoint); File.WriteAllText(file, nameof(WebServer));