hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [4/6] httpcomponents-client git commit: Fixed NPE in case of a missing Max-Forwards header
Date Mon, 16 Oct 2017 12:53:50 GMT
Fixed NPE in case of a missing Max-Forwards header


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/25d33819
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/25d33819
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/25d33819

Branch: refs/heads/master
Commit: 25d3381904e1427983cc1f87e8b7e6e1cc18bbfd
Parents: 38a9276
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Sun Oct 15 13:31:13 2017 +0200
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Mon Oct 16 14:34:52 2017 +0200

----------------------------------------------------------------------
 .../org/apache/hc/client5/http/impl/cache/CachingExecBase.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/25d33819/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java
----------------------------------------------------------------------
diff --git a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java
b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java
index 5117eb8..1ab84d6 100644
--- a/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java
+++ b/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java
@@ -354,7 +354,8 @@ public class CachingExecBase {
             return false;
         }
 
-        if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue()))
{
+        final Header h = request.getFirstHeader(HeaderConstants.MAX_FORWARDS);
+        if (!"0".equals(h != null ? h.getValue() : null)) {
             return false;
         }
 


Mime
View raw message