Skip to content

Commit

Permalink
Don't make assumptions about the UriTemplateHandler
Browse files Browse the repository at this point in the history
Fixes gh-115
  • Loading branch information
dsyer committed Nov 22, 2017
1 parent 2eb6470 commit 9b61b33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions spring-cloud-gateway-mvc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
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.
Expand Down Expand Up @@ -463,9 +462,7 @@ private NestedTemplate createTemplate(RestTemplate input) {
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;
Expand Down

0 comments on commit 9b61b33

Please sign in to comment.