mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-28 23:06:43 -04:00
New: Use System.Text.Json for Nancy and SignalR
This commit is contained in:
@@ -51,7 +51,7 @@ namespace NzbDrone.Integration.Test.Client
|
||||
throw response.ErrorException;
|
||||
}
|
||||
|
||||
AssertDisableCache(response.Headers);
|
||||
AssertDisableCache(response);
|
||||
|
||||
response.ErrorMessage.Should().BeNullOrWhiteSpace();
|
||||
|
||||
@@ -68,9 +68,10 @@ namespace NzbDrone.Integration.Test.Client
|
||||
return Json.Deserialize<T>(content);
|
||||
}
|
||||
|
||||
private static void AssertDisableCache(IList<Parameter> headers)
|
||||
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, must-revalidate, no-cache, max-age=0".Split(',').Select(x => x.Trim()));
|
||||
headers.Single(c => c.Name == "Pragma").Value.Should().Be("no-cache");
|
||||
|
||||
@@ -28,6 +28,7 @@ using Readarr.Api.V1.Profiles.Quality;
|
||||
using Readarr.Api.V1.RootFolders;
|
||||
using Readarr.Api.V1.Tags;
|
||||
using RestSharp;
|
||||
using RestSharp.Serializers.SystemTextJson;
|
||||
|
||||
namespace NzbDrone.Integration.Test
|
||||
{
|
||||
@@ -98,6 +99,7 @@ namespace NzbDrone.Integration.Test
|
||||
RestClient = new RestClient(RootUrl + "api/v1/");
|
||||
RestClient.AddDefaultHeader("Authentication", ApiKey);
|
||||
RestClient.AddDefaultHeader("X-Api-Key", ApiKey);
|
||||
RestClient.UseSystemTextJson();
|
||||
|
||||
Blacklist = new ClientBase<BlacklistResource>(RestClient, ApiKey);
|
||||
Commands = new CommandClient(RestClient, ApiKey);
|
||||
|
||||
Reference in New Issue
Block a user