spring-cloud-openfeign
spring-cloud-openfeign copied to clipboard
Enable X-Forwarded Headers.
spring.cloud.loadbalancer.x-forwarded.enabled=true
to Enable X-Forwarded Headers.
Codecov Report
Merging #748 (787e386) into main (666a59d) will increase coverage by
0.62%
. The diff coverage is88.23%
.
Additional details and impacted files
@@ Coverage Diff @@
## main #748 +/- ##
============================================
+ Coverage 78.48% 79.11% +0.62%
+ Complexity 549 543 -6
============================================
Files 66 66
Lines 2045 2030 -15
Branches 281 276 -5
============================================
+ Hits 1605 1606 +1
+ Misses 282 264 -18
- Partials 158 160 +2
Impacted Files | Coverage Δ | |
---|---|---|
...ign/loadbalancer/XForwardedHeadersTransformer.java | 87.50% <87.50%> (ø) |
|
...adbalancer/FeignLoadBalancerAutoConfiguration.java | 100.00% <100.00%> (ø) |
|
...gframework/cloud/openfeign/support/FeignUtils.java | 80.00% <0.00%> (-6.67%) |
:arrow_down: |
...amework/cloud/openfeign/FeignClientsRegistrar.java | 76.92% <0.00%> (-1.93%) |
:arrow_down: |
...enfeign/annotation/QueryMapParameterProcessor.java | 87.50% <0.00%> (-1.39%) |
:arrow_down: |
...amework/cloud/openfeign/support/SpringEncoder.java | 84.14% <0.00%> (-0.74%) |
:arrow_down: |
...mework/cloud/openfeign/FeignAutoConfiguration.java | 90.14% <0.00%> (-0.14%) |
:arrow_down: |
...gframework/cloud/openfeign/FeignClientBuilder.java | 84.37% <0.00%> (ø) |
|
...ork/cloud/openfeign/DefaultFeignLoggerFactory.java | 100.00% <0.00%> (ø) |
|
...eign/annotation/CookieValueParameterProcessor.java | 94.11% <0.00%> (ø) |
|
... and 5 more |
Can you please explain why this is needed? Feign isn't a proxy
hello @spencergibb , RestTemplate
migrates to OpenFeign
. RestTemplate
provides org.springframework.cloud.loadbalancer.blocking.XForwardedHeadersTransforme
, but OpenFeign
does not provide XForwardedHeadersTransformer
Refer to RestTemplate and WebClient .
Check Set 'X-Forwarded-*' header when using loadbalanced RestTemplate issus, Don't know why OpenFeign doesn't provide support
@spencergibb
hello @spencergibb , Please consider merging this PR
hello @OlgaMaciaszek , I have updated the document,
I think these documents should be placed in Spring Cloud Commons
@galaxy-sea it is already documented there. But it's good to reiterate here, since we add the code separately (there's no full parity between the OF LB client and the Commons LB clients).
@galaxy-sea it is already documented there. But it's good to reiterate here, since we add the code separately (there's no full parity between the OF LB client and the Commons LB clients).
@OlgaMaciaszek, Thank you for unlocking my doubts