Skip to content

Commit

Permalink
Fix issue with partials
Browse files Browse the repository at this point in the history
  • Loading branch information
geoperez committed Dec 5, 2016
1 parent 324608c commit 5c37975
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Unosquare.Labs.EmbedIO/Modules/StaticFilesModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,15 @@ 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;
}

if (range.Length == 2 && string.IsNullOrWhiteSpace(range[0]) &&
int.TryParse(range[1], out upperByteIndex))
{
lowerByteIndex = (int) fileSize - upperByteIndex;
upperByteIndex = (int) fileSize - 1;
upperByteIndex = (int) fileSize;
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Unosquare.Labs.EmbedIO/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.0-*",
"version": "1.2.3-*",
"buildOptions": {
"xmlDoc": true
},
Expand Down
4 changes: 2 additions & 2 deletions test/Unosquare.Labs.EmbedIO.Tests/StaticFilesModuleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 5c37975

Please sign in to comment.