knative / knative/serving

Enable CORS configuration

Open
#10,040 27 comments 1 reaction 3 assignees Claimed by @ZhiminXiang View on GitHub
area/networking kind/feature lifecycle/frozen
Dominant language
Go
Stars
6.1k
Forks
1.2k
Avg merge
2d 7h
Merged PRs (30d)
2

Description

## In what area(s)?

/area networking

## Describe the feature

We should enable Cross-Origin Resource Sharing (CORS) configuration in `ksvc`’s annotations

Reconciler reconcile CORS info from `ksvc (annotations)` to `virtualservice`: `ksvc(annotations) -> route(annotations) -> kingress( Entity spec) -> virtualservice `

we can config by doing that:
* Configurations set in `config-domain` for default
* Configuration set in `ksvc` or `route` for each service

Fields included listed as follows, like istio [Corspolicy](https://istio.io/latest/docs/reference/config/networking/virtual-service/#CorsPolicy)

```yaml
corsPolicy:
allowOrigins:
- exact: https://example.com
allowMethods:
- POST
- GET
allowCredentials: false
allowHeaders:
- X-Foo-Bar
maxAge: "24h"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.