Skip to content

Commit

Permalink
Use metadata keys last-modified and etag; fixes #109
Browse files Browse the repository at this point in the history
  • Loading branch information
jnioche committed Jul 4, 2016
1 parent 4ab3ff4 commit 53749f5
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ public ProtocolResponse getProtocolOutput(String url, Metadata md)
httpget.setConfig(requestConfig);

if (md != null) {
String ifModifiedSince = md.getFirstValue("cachedLastModified");
if (StringUtils.isNotBlank(ifModifiedSince)) {
httpget.addHeader("If-Modified-Since", ifModifiedSince);
String lastModified = md.getFirstValue("last-modified");
if (StringUtils.isNotBlank(lastModified)) {
httpget.addHeader("If-Modified-Since", lastModified);
}

String ifNoneMatch = md.getFirstValue("cachedEtag");
String ifNoneMatch = md.getFirstValue("etag");
if (StringUtils.isNotBlank(ifNoneMatch)) {
httpget.addHeader("If-None-Match", ifNoneMatch);
}
Expand Down

0 comments on commit 53749f5

Please sign in to comment.