HTTPCLIENT-2051: Change POST to GET for 301, 302 and 303 redirects. Other unsafe methods to be redirected as is.
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncRedirectExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncRedirectExec.java
index ef7a138..03a770d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncRedirectExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/AsyncRedirectExec.java
@@ -143,7 +143,7 @@
                         case HttpStatus.SC_MOVED_PERMANENTLY:
                         case HttpStatus.SC_MOVED_TEMPORARILY:
                         case HttpStatus.SC_SEE_OTHER:
-                            if (!Method.isSafe(request.getMethod())) {
+                            if (Method.POST.isSame(request.getMethod())) {
                                 state.currentRequest = new BasicHttpRequest(Method.GET, redirectUri);
                                 state.currentEntityProducer = null;
                             }
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RedirectExec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RedirectExec.java
index bdd3219..d6ec2f5 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RedirectExec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RedirectExec.java
@@ -146,7 +146,7 @@
                         case HttpStatus.SC_MOVED_PERMANENTLY:
                         case HttpStatus.SC_MOVED_TEMPORARILY:
                         case HttpStatus.SC_SEE_OTHER:
-                            if (!Method.isSafe(request.getMethod())) {
+                            if (Method.POST.isSame(request.getMethod())) {
                                 redirect = new HttpGet(redirectUri);
                             }
                     }