-
Notifications
You must be signed in to change notification settings - Fork 711
Enabling CORS for a HTTPRoute #567
Copy link
Copy link
Closed
Labels
Milestone
Description
Description:
I see two ways to enable CORS in for a HTTPRoute either via a targetRef from a Policy resource or an extensionRef from a custom route filter.
Will envoy-gateway support another CR like below for this purpose?
apiVersion: gateway.envoy.io/v1alpha1
kind: CORSPolicy
metadata:
name: cors-policy-1
Spec:
default:
corsConfigurationEnabled: true
accessControlAllowOrigins:
- '*'
accessControlAllowCredentials: true
accessControlAllowHeaders:
- authorization
- Access-Control-Allow-Origin
- Content-Type
- accept
- origin
accessControlAllowMethods:
- GET
- PUT
- POST
- DELETE
- PATCH
- OPTIONS
targetRef:
kind: HTTPRoute / Gateway
name: http-route-1 / my-gateway
with this setting, it should be able to configure cors filter in HTTPRoute or Gateway levels.
Any thoughts?
Thanks!
Reactions are currently unavailable