arturobernalg commented on code in PR #850:
URL:
https://github.com/apache/httpcomponents-client/pull/850#discussion_r3589779012
##########
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/AsyncCachingExec.java:
##########
@@ -302,7 +302,7 @@ public void completed(final CacheMatch result) {
final CacheHit root = result != null ? result.root : null;
if (hit == null) {
if (requestCollapsingEnabled && root == null &&
!requestCacheControl.isOnlyIfCached()) {
- final String cacheKey =
CacheKeyGenerator.INSTANCE.generateKey(target, cacheRequest);
+ final String cacheKey =
CacheKeyGenerator.INSTANCE.generateKey(target, cacheRequest,
SimpleHttpRequest::getBodyText);
Review Comment:
Would it make more sense to use byte[] here and
SimpleHttpRequest::getBodyBytes at the call sites? getBodyText() can collapse
different binary or invalid byte sequences into the same String, which would
make the eventual cache key ambiguous.
--
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]