Fixe the download type for test files so builds pass.

This commit is contained in:
Timothy Baldridge 2019-11-18 22:24:05 -07:00
parent 641dd36d7f
commit 5fcb0bad94
3 changed files with 9 additions and 3 deletions

View File

@ -35,7 +35,7 @@ namespace Wabbajack.CacheServer.Test
{
_client.GetStringSync("/v1/games/skyrim/mods/70260.json");
_client.GetStringSync("/v1/games/fallout4/mods/38590/files/156741.json");
_client.GetStringAsync(
_client.GetStringSync(
"/nexus_cache_dir/68747470733a2f2f6170692e6e657875736d6f64732e636f6d2f76312f67616d65732f6f626c6976696f6e2f6d6f64732f383530302f66696c65732f363939332e6a736f6e.json");
}
}

View File

@ -71,7 +71,7 @@ namespace Wabbajack.CacheServer
var url = new Uri(Encoding.UTF8.GetString(param.FromHex()));
var path = Path.Combine(NexusApiClient.LocalCacheDir, arg.request + ".json");
if (File.Exists(path))
if (!File.Exists(path))
{
Utils.Log($"{DateTime.Now} - Not Cached - {url}");
var client = new HttpClient();

View File

@ -1,9 +1,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Nancy;
using Nancy.Responses;
namespace Wabbajack.CacheServer
{
@ -16,7 +18,11 @@ namespace Wabbajack.CacheServer
public TestingEndpoints() : base("/")
{
Get("/WABBAJACK_TEST_FILE.txt", _ => "Cheese for Everyone!");
Get("/WABBAJACK_TEST_FILE.zip", _ => "Cheese for Everyone!");
Get("/WABBAJACK_TEST_FILE.zip", _ =>
{
var response = new StreamResponse(() => new MemoryStream(Encoding.UTF8.GetBytes("Cheese for Everyone!")), "application/zip");
return response.AsAttachment("WABBAJACK_TEST_FILE.zip");
});
}
}
}