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
Some checks failed
CI/CD / build-and-test (push) Has been cancelled
This commit is contained in:
parent
c124e3d0c6
commit
2f0d63a90f
2 changed files with 5 additions and 6 deletions
|
@ -1,9 +1,7 @@
|
||||||
services:
|
services:
|
||||||
|
|
||||||
guestbooky-be:
|
guestbooky-be:
|
||||||
build:
|
image: cotti/guestbooky-be
|
||||||
context: ../
|
|
||||||
dockerfile: build/guestbooky-be/Dockerfile
|
|
||||||
container_name: guestbooky-be
|
container_name: guestbooky-be
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
|
|
|
@ -74,9 +74,10 @@ namespace Guestbooky.API
|
||||||
var corsOrigins = builder.Configuration[Constants.CORS_ORIGINS]?.Split(',') ?? Array.Empty<string>();
|
var corsOrigins = builder.Configuration[Constants.CORS_ORIGINS]?.Split(',') ?? Array.Empty<string>();
|
||||||
cfg.AddPolicy(name: "local", policy =>
|
cfg.AddPolicy(name: "local", policy =>
|
||||||
{
|
{
|
||||||
policy.WithOrigins(corsOrigins);
|
policy.WithExposedHeaders("Content-Range", "Accept-Ranges")
|
||||||
policy.AllowAnyHeader();
|
.WithOrigins(corsOrigins)
|
||||||
policy.AllowAnyMethod();
|
.AllowAnyHeader()
|
||||||
|
.WithMethods("GET", "POST", "DELETE", "OPTIONS");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue