Commit 02226f93 by Ryan Baxter

Fixes the addition of http with EL syntax. Fixes #1796

parent d3314447
...@@ -248,7 +248,7 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar, ...@@ -248,7 +248,7 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar,
private String getUrl(Map<String, Object> attributes) { private String getUrl(Map<String, Object> attributes) {
String url = resolve((String) attributes.get("url")); String url = resolve((String) attributes.get("url"));
if (StringUtils.hasText(url) && !(url.startsWith("#{") && url.endsWith("}"))) { if (StringUtils.hasText(url) && !(url.startsWith("#{") && url.contains("}"))) {
if (!url.contains("://")) { if (!url.contains("://")) {
url = "http://" + url; url = "http://" + url;
} }
......
...@@ -88,13 +88,13 @@ public class FeignHttpClientUrlTests { ...@@ -88,13 +88,13 @@ public class FeignHttpClientUrlTests {
Hello getHello(); Hello getHello();
} }
@FeignClient(name = "beanappurl", url = "#{SERVER_URL}") @FeignClient(name = "beanappurl", url = "#{SERVER_URL}path")
protected interface BeanUrlClient { protected interface BeanUrlClient {
@RequestMapping(method = RequestMethod.GET, value = "/hello") @RequestMapping(method = RequestMethod.GET, value = "/hello")
Hello getHello(); Hello getHello();
} }
@FeignClient(name = "beanappurlnoprotocol", url = "#{SERVER_URL_NO_PROTOCOL}") @FeignClient(name = "beanappurlnoprotocol", url = "#{SERVER_URL_NO_PROTOCOL}path")
protected interface BeanUrlClientNoProtocol { protected interface BeanUrlClientNoProtocol {
@RequestMapping(method = RequestMethod.GET, value = "/hello") @RequestMapping(method = RequestMethod.GET, value = "/hello")
Hello getHello(); Hello getHello();
...@@ -113,6 +113,11 @@ public class FeignHttpClientUrlTests { ...@@ -113,6 +113,11 @@ public class FeignHttpClientUrlTests {
return new Hello("hello world 1"); return new Hello("hello world 1");
} }
@RequestMapping(method = RequestMethod.GET, value = "/path/hello")
public Hello getHelloWithPath() {
return getHello();
}
@Bean(name="SERVER_URL") @Bean(name="SERVER_URL")
public String serverUrl() { public String serverUrl() {
return "http://localhost:" + port + "/"; return "http://localhost:" + port + "/";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment