I'm modifying routes by setting GATEWAY_REQUEST_URL_ATTR attribute in a custom filter.

exchange.getAttributes().put(ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR, new URI("http://example.com"));

Works great but sends a redirect to the browser while I'd like to keep the original URL.

There is a similar issue discussed on github but the solution doesn't seem to work for me - resetting location in another filter makes browser redirect to that location i.e. the original URL, therefore making the whole routing recursive.

Spring cloud Greenwich.SR1

Any advice appreciated.

0 Answers