Merge branch '2.0.x'

This commit is contained in:
Spencer Gibb
2018-08-14 12:59:59 -04:00
3 changed files with 44 additions and 6 deletions

View File

@@ -70,11 +70,8 @@ public class GatewaySampleApplication {
)
.route("rewrite_request_obj", r -> r.host("*.rewriterequestobj.org")
.filters(f -> f.prefixPath("/httpbin")
//TODO: add as configuration to modifyRequestBody
.setRequestHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE)
.removeRequestHeader("Content-Length")
.addResponseHeader("X-TestHeader", "rewrite_request")
.modifyRequestBody(String.class, Hello.class,
.modifyRequestBody(String.class, Hello.class, MediaType.APPLICATION_JSON_VALUE,
(exchange, s) -> {
return Mono.just(new Hello(s.toUpperCase()));
})
@@ -83,7 +80,6 @@ public class GatewaySampleApplication {
.route("rewrite_request_upper", r -> r.host("*.rewriterequestupper.org")
.filters(f -> f.prefixPath("/httpbin")
.addResponseHeader("X-TestHeader", "rewrite_request_upper")
.removeRequestHeader("Content-Length")
.modifyRequestBody(String.class, String.class,
(exchange, s) -> {
return Mono.just(s.toUpperCase()+s.toUpperCase());