Skip to content

Commit

Permalink
cors updates (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Jan 1, 2025
1 parent b42cd1c commit ae707e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace DragonFruit.OnionFruit.Web.Controllers;
[EnableCors("Assets")]
public class AssetDownloadController(IRemoteAssetStore assetStore) : ControllerBase
{
[HttpGet, HttpHead]
[HttpGet]
[ResponseCache(NoStore = true)]
[Route("~/assets/{*assetPath}")]
public async Task<IActionResult> ResolveAssetPath(string assetPath)
Expand Down
5 changes: 3 additions & 2 deletions DragonFruit.OnionFruit.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public static async Task Main(string[] args)

cors.AddPolicy("Assets", policy =>
{
policy.WithMethods("GET", "HEAD");
policy.WithExposedHeaders("X-Asset-Location");
policy.WithMethods("GET");
policy.WithHeaders("If-Modified-Since");
policy.WithExposedHeaders("ETag", "X-Asset-Location");

policy.SetIsOriginAllowed(IsValidOrigin);
policy.SetPreflightMaxAge(TimeSpan.FromHours(12));
Expand Down

0 comments on commit ae707e6

Please sign in to comment.