hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kyle leonhard (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1415) Cached entry is not flushed when a response contains a content-location header without an ETag header field
Date Mon, 07 Oct 2013 05:18:41 GMT
kyle leonhard created HTTPCLIENT-1415:
-----------------------------------------

             Summary: Cached entry is not flushed when a response contains a content-location
header without an ETag header field
                 Key: HTTPCLIENT-1415
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1415
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpCache
    Affects Versions: 4.3 Final
         Environment: Windows 7, Tomcat
            Reporter: kyle leonhard


When a response returns a content-location header, flushLocationCacheEntry is invoked on the
content-location's URL.  flushLocationCacheEntry causes the cached entry to be flushed if
the entry is older than the response and the etags differ.

However, the response and entry ETags are not considered different if either ETag header values
are null(see:CacheInvalidator.responseAndEntryEtagsDiffer).

I'm not familiar with the HTTP spec, but the responseAndEntryEtagsDiffer, ETag null checks
seem iffy.

**Relevant code

***From CacheInvalidator.flushInvalidatedCacheEntries:
final URL contentLocation = getContentLocationURL(reqURL, response);
if (contentLocation != null) {
    flushLocationCacheEntry(reqURL, response, contentLocation);
}

***From CacheInvalidator.flushLocationCacheEntry
if (responseDateOlderThanEntryDate(response, entry)) {
   return;
}
if (!responseAndEntryEtagsDiffer(response, entry)) {
    return;
}

***From CacheInvalidator.responseAndEntryEtagsDiffer:
if (entryEtag == null || responseEtag == null) {
    return false;
}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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


Mime
View raw message