docs: private static boolean isRequestRewriteNeeded(HttpMessage message) {
          int statusCode = message.getResponseHeader().getStatusCode();
          String method = message.getRequestHeader().getMethod();
          if (statusCode == 301 || statusCode == 302) {
              return HttpRequestHeader.POST.equalsIgnoreCase(method);
          }
          return statusCode == 303
                  && !(HttpRequestHeader.GET.equalsIgnoreCase(method) || HttpRequestHeader.HEAD.equalsIgnoreCase(method));
      }