alibaba / alibaba/virtual-environment

kt-virtual-environment/rule配置不支持corsPolicy.allowOrigins属性

Open
#36 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
222
Forks
40
PR merge metrics
No merged PRs in 30d

Description

使用如下json:

```json
{
"Match": [
{
"Uri": {
"Prefix": "/"
}
}
],
"corsPolicy": {
"allowOrigins": [
{
"exact": "*"
}
],
"allowCredentials": true,
"allowHeaders": [
"app-key",
"yizhou-j-token"
],
"allowMethods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"OPTIONS"
]
}
}
```

最后生成的配置

![image](https://user-images.githubusercontent.com/1113435/150968973-676ae53d-52bd-4df7-b8a6-9b1c4aaa2d99.png)

此段json未生效 `"corsPolicy":{"allowOrigins":[{"exact":"*"}]`,缺失以下配置:

```yaml
allowOrigins:
- exact: '*'
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue using the JSON configuration shown and compare it with the generated YAML. Trace how rule configuration handles corsPolicy.allowOrigins; the fix is complete when the generated configuration preserves allowOrigins with the exact value '*', and the behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.