I know automatically following permanent redirects follows the spec, but I use RestBuilder extensively for integration testing. It would be nice to turn this off so that redirects can be properly tested.
My current workaround looks like this:
RestBuilder restBuilder = new RestBuilder()
restBuilder.restTemplate = new RestTemplate(new HttpRequestFactoryWithoutRedirectFollowing())
and here's the ClientHttpRequestFactory implementation:
I know automatically following permanent redirects follows the spec, but I use
RestBuilder
extensively for integration testing. It would be nice to turn this off so that redirects can be properly tested.My current workaround looks like this:
and here's the ClientHttpRequestFactory implementation:
Instead, I think it would be cleaner to turn this off via configuration (similiar to other connection properties). For example: