-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support customizing CORS configuration (#6981)
#### What type of PR is this? /kind improvement /area core /milestone 2.20.x #### What this PR does / why we need it: This PR adds CorsOptions into SecurityProperties to let users customize their own CORS configuration. e.g.: ```yaml halo: security: cors-options: disabled: false configs: - pathPattern: /apis/first.api.halo.run/v1alpha1/** config: allowedOrigins: [ "*" ] allowedHeaders: [ "*" ] allowedMethods: [ "*" ] exposedHeaders: [ "*" ] allowCredentials: true maxAge: 30m - pathPattern: /apis/second.api.halo.run/v1alpha1/** config: allowedOrigins: [ "www.halo.run", "www.lxware.cn" ] allowedHeaders: [ "Content-Type", "Authorization" ] allowedMethods: [ "GET, POST, PUT, DELETE" ] allowedCredentials: false maxAge: 1h ``` #### Does this PR introduce a user-facing change? ```release-note 支持自定义跨域配置 ```
- Loading branch information
Showing
2 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters