You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/10/17 19:39:56 UTC

[httpcomponents-client] branch master updated: Change loop that don't loop for "if" conditions.

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


The following commit(s) were added to refs/heads/master by this push:
     new af09804  Change loop that don't loop for "if" conditions.
af09804 is described below

commit af098048b909de7650476ddb6c39c30e3efaea22
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Sun Oct 17 15:46:36 2021 +0200

    Change loop that don't loop for "if" conditions.
---
 .../org/apache/hc/client5/http/impl/cache/ResponseCachingPolicy.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ResponseCachingPolicy.java b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ResponseCachingPolicy.java
index 9c787b6..9408669 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ResponseCachingPolicy.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/ResponseCachingPolicy.java
@@ -302,7 +302,7 @@ class ResponseCachingPolicy {
 
     private boolean from1_0Origin(final HttpResponse response) {
         final Iterator<HeaderElement> it = MessageSupport.iterate(response, HeaderConstants.VIA);
-        while (it.hasNext()) {
+        if (it.hasNext()) {
             final HeaderElement elt = it.next();
             final String proto = elt.toString().split("\\s")[0];
             if (proto.contains("/")) {