本文主要是介绍Spring Cloud Gateway CORS 跨域方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
通过配置文件,以下配置就是其中一种方案。
gateway:
#跨域配置globalcors: cors-configurations: '[/**]': allowedMethods: "*"allowedHeaders: "*"allowedOriginPatterns: "*"allowCredentials: truedefault-filters: - DedupeResponseHeader=Vary Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_FIRST
这篇关于Spring Cloud Gateway CORS 跨域方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!