【问题标题】:Using Eureka with Ribbon doesn't send custom header将 Eureka 与 Ribbon 一起使用不会发送自定义标头
【发布时间】:2015-08-09 16:26:37
【问题描述】:

当前项目使用 spring-cloud-starter-eureka 版本 1.0.0.RELEASE。

我正在使用 Ribbon 连接到其他一些服务并需要自定义标头。

@Autowired
private RestTemplate restTemplate;
. . .
ResponseEntity result = this.restTemplate.exchange("https://FooServices/foos/daily", 
        HttpMethod.GET, 
        new HttpEntity(getSpecialHeaders()), 
        FooView[].class, 
        new Object[0]);

该代码适用于 Spring Cloud 1.0.0 版。但是,当我移动到 1.0.1 或 1.0.2 时,不再发送自定义标头。

这是出于安全原因而更改还是存在缺陷?

【问题讨论】:

    标签: spring-cloud netflix netflix-eureka


    【解决方案1】:

    这是一个bug that has been fixed。它只是需要被释放。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-02
      • 2020-10-15
      • 2021-11-03
      • 2016-11-22
      • 2012-11-26
      • 1970-01-01
      • 2012-10-02
      • 1970-01-01
      相关资源
      最近更新 更多