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


##########
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheKeyGenerator.java:
##########
@@ -94,18 +96,67 @@ public String generateKey(final HttpHost host, final 
HttpRequest request) {
         }
     }
 
-    private String getFullHeaderValue(final Header[] headers) {
-        if (headers == null) {
-            return "";
+    /**
+     * Returns all variant names contained in {@literal VARY} headers of the 
given message.
+     *
+     * @since 5.3
+     */
+    public static List<String> variantNames(final MessageHeaders message) {
+        if (message == null) {
+            return null;
+        }
+        if (!message.containsHeader(HttpHeaders.VARY)) {

Review Comment:
   @arturobernalg It is a very valid point. It is a trade-off to save one 
intermediate object allocation if no `Vary` headers are present, but may be it 
is not worth it. I will get rid of it.



-- 
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