netflix-zuul – Spring Cloud Brixton.RELEASE zuul

我是
Spring的新手,在我的项目中(使用spring boot的微服务项目构建),我使用了Spring云版本Brixton.RC2,它运行良好.但是当我尝试将其版本升级到Brixton.RELEASE时,该项目不适用于zuul(如果我直接访问web微服务,它可以工作,但如果我通过zuul访问,它不起作用),我没有改变任何东西在配置中. maven依赖是:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>1.3.5.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-parent</artifactId>
            <version>Brixton.RC2</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

任何人都可以指出我的项目出了什么问题?

谢谢和最好的问候!

最佳答案 即使我有同样的问题.我在Brixton.M4上升级到Brixton.Release.发生的事情是,当您登录时,请求正在进入网关并被路由到ouath服务器.但是当zuul路由登录请求时,标头丢失.即clientId的base64的授权头:缺少clientSecret.这是因为zuul中的敏感标题,这是Spring Cloud Netflix 1.1中的新功能.有关更多信息,请参阅
https://github.com/spring-cloud/spring-cloud-netflix/blob/master/docs/src/main/asciidoc/spring-cloud-netflix.adoc#cookies-and-sensitive-headers.

zuul.routes.myroute.sensitiveHeaders=”

到你的application.yml或application.properties,它会将sensitiveHeaders的默认值覆盖为空.

点赞