Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After modifying the header and re-routing, the CORS policy fails to take effect. #1769

Open
zukadong opened this issue Feb 17, 2025 · 3 comments · May be fixed by higress-group/envoy#4
Open
Assignees

Comments

@zukadong
Copy link

Why do you need it?

Is your feature request related to a problem? Please describe in details

How could it be?

A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.

Image

Other related information

Add any other context or screenshots about the feature request here.

@johnlanni
Copy link
Collaborator

嗯,现在如果没有经过decodeHeader阶段,cors在encodeHeader阶段的逻辑就无法生效。
因为修改header前匹配的路由(也可能没有匹配到路由),没有开启cors,而cors filter的decodeHeader阶段已经执行了,所以后面修改header匹配到新的路由后,cors filter的decodeHeader阶段不会执行,cors功能就无法生效了。
我们会修改下 envoy的代码来解决这个问题。

短期解决方案可以:

  1. 给修改header前匹配的路由配置上cors
  2. 使用 cors 插件,并域名级开启

@johnlanni johnlanni changed the title 配置请求响应转换插件后,路由级跨域失效 After modifying the header and re-routing, the CORS policy fails to take effect. Feb 17, 2025
@johnlanni johnlanni added the help wanted Extra attention is needed label Feb 17, 2025
@github-project-automation github-project-automation bot moved this to Todo in Higress Feb 17, 2025
@wilkinszhang
Copy link

I want to have a try, plz assign to me, thanks.

@CH3CHO CH3CHO removed the help wanted Extra attention is needed label Feb 20, 2025
@johnlanni
Copy link
Collaborator

@wilkinszhang

I want to have a try, plz assign to me, thanks.

Regarding the changes to envoy, if you have any issues, feel free to reach out to me on DingTalk. My DingTalk ID is: chengtanzty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

4 participants