1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-25 22:37:27 -04:00

New: Use ASP.NET Core instead of Nancy

This commit is contained in:
ta264
2021-10-21 21:04:19 +01:00
committed by Qstick
parent c14ef7bee7
commit 2d53ec24f8
160 changed files with 2866 additions and 3657 deletions
@@ -51,12 +51,7 @@ namespace NzbDrone.Integration.Test.Client
throw response.ErrorException;
}
var headers = response.Headers;
((string)headers.Single(c => c.Name == "Cache-Control").Value).Split(',').Select(x => x.Trim())
.Should().BeEquivalentTo("no-store, must-revalidate, no-cache, max-age=0".Split(',').Select(x => x.Trim()));
headers.Single(c => c.Name == "Pragma").Value.Should().Be("no-cache");
headers.Single(c => c.Name == "Expires").Value.Should().Be("0");
AssertDisableCache(response);
response.ErrorMessage.Should().BeNullOrWhiteSpace();
@@ -72,6 +67,16 @@ namespace NzbDrone.Integration.Test.Client
return Json.Deserialize<T>(content);
}
private static void AssertDisableCache(IRestResponse response)
{
// cache control header gets reordered on net core
var headers = response.Headers;
((string)headers.Single(c => c.Name == "Cache-Control").Value).Split(',').Select(x => x.Trim())
.Should().BeEquivalentTo("no-store, no-cache".Split(',').Select(x => x.Trim()));
headers.Single(c => c.Name == "Pragma").Value.Should().Be("no-cache");
headers.Single(c => c.Name == "Expires").Value.Should().Be("-1");
}
}
public class ClientBase<TResource> : ClientBase