@Override
    public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) {
        if (!response.containsHeader(HttpHeaders.LOCATION)) {
            return false;
        }

        final int statusCode = response.getCode();
        final String method = request.getMethod();
        final Header locationHeader = response.getFirstHeader("location");
        switch (statusCode) {
            case HttpStatus.SC_MOVED_TEMPORARILY:
                return isRedirectable(method) && locationHeader != null;
            case HttpStatus.SC_MOVED_PERMANENTLY:
            case HttpStatus.SC_TEMPORARY_REDIRECT:
                return isRedirectable(method);
            case HttpStatus.SC_SEE_OTHER:
                return true;
            default:
                return false;
        }
    }
A lax implementation of the {@link RedirectStrategy} that automatically handles HTTP redirects
for HEAD, GET, POST, and DELETE requests based on the response status code.

<p>This strategy relaxes the HTTP specification restrictions on automatic redirection of POST
requests, allowing redirects for these methods where the specification might otherwise prohibit
them. This can be useful in scenarios where a server indicates a redirect for a POST request
that the client should follow.</p>

<p>This class is thread-safe and stateless, suitable for use across multiple threads
without additional synchronization.</p>

@since 5.4
httpclient5/src/main/java/org/apache/hc/client5/http/impl/LaxRedirectStrategy.java