1

Spring Cloud Gateway 返回多个 access-control-allow-origin

 2 years ago
source link: https://www.v2ex.com/t/840010
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  程序员

Spring Cloud Gateway 返回多个 access-control-allow-origin

  JasonLaw · 3 小时 54 分钟前 · 249 次点击

如下图所示,OPTIONS 请求的 Response Headers 中存在两个 access-control-allow-headers 、access-control-allow-methods 、access-control-allow-origin 。

我看了Doubled CORS headers after upgrade to Greenwich · Issue #728 · spring-cloud/spring-cloud-gateway,加上了DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin这个 filter ,但是并没有效果,还是存在两个 headers 。

我尝试过“去除 downstream 的 CORS 配置,保留 gateway 的”,结果还是存在两个 headers 。我尝试过“去除 gateway 的 CORS 配置,保留 downstream 的”,结果是 header 都没有了,如下图所示:

实在想不明白是哪里出现问题了🤐,看看大家有没有点头绪。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK