Don't make assumptions about the UriTemplateHandler

Fixes gh-115
This commit is contained in:
Dave Syer
2017-11-22 09:24:38 +00:00
parent 2eb6470822
commit 9b61b3387f
2 changed files with 6 additions and 4 deletions

View File

@@ -25,6 +25,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>

View File

@@ -66,7 +66,6 @@ import org.springframework.web.context.request.WebRequest;
import org.springframework.web.method.support.ModelAndViewContainer;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor;
import org.springframework.web.util.AbstractUriTemplateHandler;
/**
* A <code>@RequestMapping</code> argument type that can proxy the request to a backend.
@@ -463,9 +462,7 @@ public class ProxyExchange<T> {
NestedTemplate rest = new NestedTemplate();
rest.setMessageConverters(input.getMessageConverters());
rest.setErrorHandler(input.getErrorHandler());
rest.setDefaultUriVariables(
((AbstractUriTemplateHandler) input.getUriTemplateHandler())
.getDefaultUriVariables());
rest.setUriTemplateHandler(input.getUriTemplateHandler());
rest.setRequestFactory(input.getRequestFactory());
rest.setInterceptors(input.getInterceptors());
return rest;