LaxRedirectStrategy.java (httpcomponents-client-4.5.9-src) | : | LaxRedirectStrategy.java (httpcomponents-client-4.5.10-src) | ||
---|---|---|---|---|
skipping to change at line 50 | skipping to change at line 50 | |||
* This strategy relaxes restrictions on automatic redirection of | * This strategy relaxes restrictions on automatic redirection of | |||
* POST methods imposed by the HTTP specification. | * POST methods imposed by the HTTP specification. | |||
* | * | |||
* @since 4.2 | * @since 4.2 | |||
*/ | */ | |||
@Contract(threading = ThreadingBehavior.IMMUTABLE) | @Contract(threading = ThreadingBehavior.IMMUTABLE) | |||
public class LaxRedirectStrategy extends DefaultRedirectStrategy { | public class LaxRedirectStrategy extends DefaultRedirectStrategy { | |||
public static final LaxRedirectStrategy INSTANCE = new LaxRedirectStrategy() ; | public static final LaxRedirectStrategy INSTANCE = new LaxRedirectStrategy() ; | |||
/** | public LaxRedirectStrategy() { | |||
* Redirectable methods. | super(new String[] { | |||
*/ | HttpGet.METHOD_NAME, | |||
private static final String[] REDIRECT_METHODS = new String[] { | HttpPost.METHOD_NAME, | |||
HttpGet.METHOD_NAME, | HttpHead.METHOD_NAME, | |||
HttpPost.METHOD_NAME, | HttpDelete.METHOD_NAME | |||
HttpHead.METHOD_NAME, | }); | |||
HttpDelete.METHOD_NAME | ||||
}; | ||||
@Override | ||||
protected boolean isRedirectable(final String method) { | ||||
for (final String m: REDIRECT_METHODS) { | ||||
if (m.equalsIgnoreCase(method)) { | ||||
return true; | ||||
} | ||||
} | ||||
return false; | ||||
} | } | |||
} | } | |||
End of changes. 1 change blocks. | ||||
18 lines changed or deleted | 7 lines changed or added |