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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]