Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ private void parseHeaders(MethodMetadata md, RequestMapping annotation) {
// TODO: only supports one header value per key
if (annotation.headers() != null) {
for (String header : annotation.headers()) {
header = resolve(header);
int index = header.indexOf('=');
if (!header.contains("!=") && index >= 0) {
md.template()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ void testHeaderPlaceholders() {
assertThat(header).as("header was wrong").isEqualTo("myPlaceholderHeaderValue");
}

@Test
void testHeaderPlaceholderExpression() {
String header = testClient.getHelloHeadersPlaceholderExpression();
assertThat(header).as("header was null").isNotNull();
assertThat(header).as("header was wrong").isEqualTo("myPlaceholderHeaderValue");
}

@Test
void testFeignClientType() {
assertThat(feignClient).isInstanceOf(FeignBlockingLoadBalancerClient.class);
Expand Down Expand Up @@ -453,6 +460,9 @@ protected interface TestClient {
headers = "myPlaceholderHeader=${feignClient.myPlaceholderHeader}")
String getHelloHeadersPlaceholders();

@GetMapping(path = "/helloheadersplaceholders", headers = "${feignClient.placeholderHeader}")
String getHelloHeadersPlaceholderExpression();

@GetMapping("/helloparams")
List<String> getParams(@RequestParam("params") List<String> params);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ feignClient:
localappName: localapp
methodLevelRequestMappingPath: /hello2
myPlaceholderHeader: myPlaceholderHeaderValue
placeholderHeader: myPlaceholderHeader=myPlaceholderHeaderValue
management.endpoints.web.expose: '*'

---
Expand Down
Loading