mirror of
https://github.com/Radarr/Radarr
synced 2025-12-07 08:54:57 +01:00
Prevent NullRef on header assert
This commit is contained in:
parent
e78bc34514
commit
a3bb0541f0
1 changed files with 1 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ private static void AssertDisableCache(IRestResponse response)
|
||||||
{
|
{
|
||||||
// cache control header gets reordered on net core
|
// cache control header gets reordered on net core
|
||||||
var headers = response.Headers;
|
var headers = response.Headers;
|
||||||
((string)headers.Single(c => c.Name == "Cache-Control").Value).Split(',').Select(x => x.Trim())
|
((string)headers.SingleOrDefault(c => c.Name == "Cache-Control")?.Value ?? string.Empty).Split(',').Select(x => x.Trim())
|
||||||
.Should().BeEquivalentTo("no-store, no-cache".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 == "Pragma").Value.Should().Be("no-cache");
|
||||||
headers.Single(c => c.Name == "Expires").Value.Should().Be("-1");
|
headers.Single(c => c.Name == "Expires").Value.Should().Be("-1");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue