ok2c commented on code in PR #453: URL: https://github.com/apache/httpcomponents-client/pull/453#discussion_r1225287909
########## httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheUpdateHandler.java: ########## @@ -123,18 +128,29 @@ public HttpCacheEntry updateParentCacheEntry( return new HttpCacheEntry( src.getRequestInstant(), src.getResponseInstant(), + src.getRequestMethod(), + src.getRequestURI(), + headers(src.requestHeaderIterator()), src.getStatus(), - src.getHeaders(), + headers(src.headerIterator()), resource, variantMap); } - private Header[] mergeHeaders(final HttpCacheEntry entry, final HttpResponse response) { - if (DateSupport.isAfter(entry, response, HttpHeaders.DATE)) { - return entry.getHeaders(); + private static HeaderGroup headers(final Iterator<Header> it) { + final HeaderGroup headerGroup = new HeaderGroup(); + while (it.hasNext()) { + headerGroup.addHeader(it.next()); } + return headerGroup; + } + + private HeaderGroup mergeHeaders(final HttpCacheEntry entry, final HttpResponse response) { Review Comment: @arturobernalg Bear with me. `Content-Length ` stuff will be gone soon. -- 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