Skip to content

Commit

Permalink
fix: CORS stopped working, this should do the trick
Browse files Browse the repository at this point in the history
  • Loading branch information
eddex committed Dec 1, 2023
1 parent c41aa48 commit 21a2e92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion KoiosProxy/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
builder.Services.AddReverseProxy()
.LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));

builder.Services.AddRateLimiter(_ =>_.AddFixedWindowLimiter("koiosRateLimiterPolicy", opt =>
builder.Services.AddRateLimiter(_ => _.AddFixedWindowLimiter("koiosRateLimiterPolicy", opt =>
{
// configured according to https://api.koios.rest/#overview--limits
opt.PermitLimit = 100;
Expand All @@ -26,6 +26,8 @@
options.AddPolicy(name: "proxyCorsPolicy", policy =>
{
policy.WithOrigins(corsOrigins?.Split(',') ?? new[] { "*" });
policy.AllowAnyHeader();
policy.AllowAnyMethod();
});
});

Expand Down

0 comments on commit 21a2e92

Please sign in to comment.