ok2c commented on code in PR #450:
URL: 
https://github.com/apache/httpcomponents-client/pull/450#discussion_r1196893022


##########
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CachingExecBase.java:
##########
@@ -198,6 +201,23 @@ SimpleHttpResponse generateCachedResponse(
         if (TimeValue.isPositive(validityPolicy.getStaleness(entry, now))) {
             cachedResponse.addHeader(HeaderConstants.WARNING,"110 localhost 
\"Response is stale\"");
         }
+
+        // Adding Warning: 113 - "Heuristic Expiration"
+        if (entry.getHeaders(HeaderConstants.WARNING).length == 0) {

Review Comment:
   @arturobernalg Please do not do that. What is the point of creating an array 
of headers just to throw it away. Please use `#containsHeader` instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to