fix: CORS on assets api (#3659)

This commit is contained in:
Livio Amstutz
2022-05-19 16:09:02 +02:00
committed by GitHub
parent a5cea82670
commit 0906c2d513
3 changed files with 17 additions and 6 deletions

View File

@@ -125,7 +125,10 @@ func GetAllPermissionsFromCtx(ctx context.Context) []string {
func checkOrigin(ctx context.Context, origins []string) error {
origin := grpc.GetGatewayHeader(ctx, http_util.Origin)
if origin == "" {
return nil
origin = http_util.OriginFromCtx(ctx)
if origin == "" {
return nil
}
}
if http_util.IsOriginAllowed(origins, origin) {
return nil