DefaultRedirectStrategy.java (httpcomponents-client-4.5.6-src) | : | DefaultRedirectStrategy.java (httpcomponents-client-4.5.7-src) | ||
---|---|---|---|---|
skipping to change at line 229 | skipping to change at line 229 | |||
final HttpResponse response, | final HttpResponse response, | |||
final HttpContext context) throws ProtocolException { | final HttpContext context) throws ProtocolException { | |||
final URI uri = getLocationURI(request, response, context); | final URI uri = getLocationURI(request, response, context); | |||
final String method = request.getRequestLine().getMethod(); | final String method = request.getRequestLine().getMethod(); | |||
if (method.equalsIgnoreCase(HttpHead.METHOD_NAME)) { | if (method.equalsIgnoreCase(HttpHead.METHOD_NAME)) { | |||
return new HttpHead(uri); | return new HttpHead(uri); | |||
} else if (method.equalsIgnoreCase(HttpGet.METHOD_NAME)) { | } else if (method.equalsIgnoreCase(HttpGet.METHOD_NAME)) { | |||
return new HttpGet(uri); | return new HttpGet(uri); | |||
} else { | } else { | |||
final int status = response.getStatusLine().getStatusCode(); | final int status = response.getStatusLine().getStatusCode(); | |||
if (status == HttpStatus.SC_TEMPORARY_REDIRECT) { | return status == HttpStatus.SC_TEMPORARY_REDIRECT | |||
return RequestBuilder.copy(request).setUri(uri).build(); | ? RequestBuilder.copy(request).setUri(uri).build() | |||
} else { | : new HttpGet(uri); | |||
return new HttpGet(uri); | ||||
} | ||||
} | } | |||
} | } | |||
} | } | |||
End of changes. 1 change blocks. | ||||
5 lines changed or deleted | 3 lines changed or added |