Fix Headers! Actually, fix the whole CORS policy. And add the image from the hub to the public docker-compose file.
Some checks failed
CI/CD / build-and-test (push) Has been cancelled

This commit is contained in:
Felipe Cotti 2024-10-30 00:13:08 -03:00
parent c124e3d0c6
commit 2f0d63a90f
2 changed files with 5 additions and 6 deletions

View file

@ -1,9 +1,7 @@
services:
guestbooky-be:
build:
context: ../
dockerfile: build/guestbooky-be/Dockerfile
image: cotti/guestbooky-be
container_name: guestbooky-be
ports:
- "8080:8080"

View file

@ -74,9 +74,10 @@ namespace Guestbooky.API
var corsOrigins = builder.Configuration[Constants.CORS_ORIGINS]?.Split(',') ?? Array.Empty<string>();
cfg.AddPolicy(name: "local", policy =>
{
policy.WithOrigins(corsOrigins);
policy.AllowAnyHeader();
policy.AllowAnyMethod();
policy.WithExposedHeaders("Content-Range", "Accept-Ranges")
.WithOrigins(corsOrigins)
.AllowAnyHeader()
.WithMethods("GET", "POST", "DELETE", "OPTIONS");
});
});