3535import org .apache .hc .client5 .http .config .RequestConfig ;
3636import org .apache .hc .client5 .http .cookie .CookieSpecFactory ;
3737import org .apache .hc .client5 .http .entity .GzipDecompressingEntity ;
38+ import org .apache .hc .client5 .http .impl .DefaultRedirectStrategy ;
3839import org .apache .hc .client5 .http .impl .DefaultSchemePortResolver ;
3940import org .apache .hc .client5 .http .impl .auth .BasicAuthCache ;
4041import org .apache .hc .client5 .http .impl .auth .BasicCredentialsProvider ;
4748import org .apache .hc .client5 .http .impl .routing .SystemDefaultRoutePlanner ;
4849import org .apache .hc .client5 .http .io .HttpClientConnectionManager ;
4950import org .apache .hc .client5 .http .protocol .HttpClientContext ;
51+ import org .apache .hc .client5 .http .protocol .RedirectStrategy ;
5052import org .apache .hc .client5 .http .routing .HttpRoutePlanner ;
5153import org .apache .hc .client5 .http .socket .ConnectionSocketFactory ;
5254import org .apache .hc .client5 .http .socket .PlainConnectionSocketFactory ;
@@ -1092,7 +1094,7 @@ protected <T> T execute(HttpClientContext context, HttpUriRequestBase request, H
10921094 Integer httpMajorVersion = (Integer ) context .getAttribute (HTTP_MAJOR_VERSION );
10931095
10941096 if (httpMajorVersion != null ){
1095- request .setVersion (new ProtocolVersion ("HTTP" , httpMajorVersion , 0 ));
1097+ request .setVersion (new ProtocolVersion ("HTTP" , httpMajorVersion , 0 ));
10961098 }
10971099 HttpContext requestLocalContext = new BasicHttpContext (context );
10981100 try
@@ -1146,7 +1148,7 @@ protected HttpClientBuilder configure(ProxySelector selector, CredentialsProvide
11461148 return HttpClients .custom ()
11471149 .setUserAgent ("Sardine/" + version )
11481150 .setDefaultCredentialsProvider (credentials )
1149- // .setRedirectStrategy(this.createDefaultRedirectStrategy())
1151+ .setRedirectStrategy (this .createDefaultRedirectStrategy ())
11501152 .setDefaultRequestConfig (RequestConfig .custom ()
11511153 // Only selectively enable this for PUT but not all entity enclosing methods
11521154 .setExpectContinueEnabled (false ).build ())
@@ -1159,10 +1161,10 @@ protected DefaultSchemePortResolver createDefaultSchemePortResolver()
11591161 return new DefaultSchemePortResolver ();
11601162 }
11611163
1162- // protected SardineRedirectStrategy createDefaultRedirectStrategy()
1163- // {
1164- // return new SardineRedirectStrategy ();
1165- // }
1164+ protected RedirectStrategy createDefaultRedirectStrategy ()
1165+ {
1166+ return new DefaultRedirectStrategy ();
1167+ }
11661168
11671169 /**
11681170 * Creates a new registry for default ports with socket factories.
0 commit comments