HTTPCLIENT-1984: Add normalize URI to RequestConfig copy constructor

This commit is contained in:
Matt Nelson 2019-04-16 12:00:27 -05:00
parent 288699c0a8
commit f27cffc3c3
No known key found for this signature in database
GPG Key ID: 57DC72975AC26C20
2 changed files with 4 additions and 1 deletions

View File

@ -399,7 +399,8 @@ public class RequestConfig implements Cloneable {
.setConnectTimeout(config.getConnectTimeout())
.setSocketTimeout(config.getSocketTimeout())
.setDecompressionEnabled(config.isDecompressionEnabled())
.setContentCompressionEnabled(config.isContentCompressionEnabled());
.setContentCompressionEnabled(config.isContentCompressionEnabled())
.setNormalizeUri(config.isNormalizeUri());
}
public static class Builder {

View File

@ -80,6 +80,7 @@ public class TestRequestConfig {
.setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM))
.setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.DIGEST))
.setContentCompressionEnabled(false)
.setNormalizeUri(false)
.build();
final RequestConfig config = RequestConfig.copy(config0).build();
Assert.assertEquals(22, config.getSocketTimeout());
@ -97,6 +98,7 @@ public class TestRequestConfig {
Assert.assertEquals(Arrays.asList(AuthSchemes.NTLM), config.getTargetPreferredAuthSchemes());
Assert.assertEquals(Arrays.asList(AuthSchemes.DIGEST), config.getProxyPreferredAuthSchemes());
Assert.assertEquals(false, config.isContentCompressionEnabled());
Assert.assertEquals(false, config.isNormalizeUri());
}
}