Skip to content

Commit

Permalink
Merge pull request #212 from dlcs/fix/manifestVaryHeader
Browse files Browse the repository at this point in the history
Add vary header to manifest
  • Loading branch information
JackLewis-digirati authored Jan 16, 2025
2 parents 751c160 + c0d3026 commit b1637a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public async Task Get_IiifManifest_Flat_ReturnsManifestFromS3_DecoratedWithDbVal
// Assert
response.StatusCode.Should().Be(HttpStatusCode.OK);
response.Headers.Should().ContainKey(HeaderNames.ETag);
response.Headers.Vary.Should().HaveCount(2);
manifest.Should().NotBeNull();
manifest!.Type.Should().Be("Manifest");
manifest.Id.Should().Be("http://localhost/1/manifests/FirstChildManifest", "requested by flat URI");
Expand Down Expand Up @@ -81,9 +82,10 @@ public async Task Get_IiifManifest_Hierarchical_ReturnsManifestFromS3()
// Assert
response.StatusCode.Should().Be(HttpStatusCode.OK);
response.Headers.Should().ContainKey(HeaderNames.ETag);
response.Headers.Vary.Should().HaveCount(2);
manifest.Should().NotBeNull();
manifest!.Type.Should().Be("Manifest");
manifest.Id.Should().Be("http://localhost/1/iiif-manifest", "requested by hierarchical URI");
manifest.Items.Should().HaveCount(3, "the test content contains 3 children");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using API.Features.Manifest.Validators;
using API.Features.Storage.Helpers;
using API.Infrastructure;
using API.Infrastructure.Filters;
using API.Infrastructure.Helpers;
using API.Infrastructure.Requests;
using API.Settings;
Expand All @@ -25,6 +26,7 @@ public class ManifestController(IOptions<ApiSettings> options, IAuthenticator au
{
[HttpGet("manifests/{id}")]
[ETagCaching]
[VaryHeader]
public async Task<IActionResult> GetManifestFlat([FromRoute] int customerId, [FromRoute] string id)
{
var pathOnly = !Request.HasShowExtraHeader() ||
Expand Down

0 comments on commit b1637a3

Please sign in to comment.