Commit 114b51ef authored by Michał Woźniak's avatar Michał Woźniak
Browse files

minor bugfix: comparing plugins for caching purposes now done against...

minor bugfix: comparing plugins for caching purposes now done against X-Samizdat-Method response header
parent 70f5b1b4
......@@ -456,13 +456,13 @@ let getResourceThroughSamizdat = (request, clientId, useStashed=true, doStash=tr
// is newer than what we've stashed
console.log('(COMMIT_UNKNOWN) checking freshness of stashed version of:', url,
'\n+-- stashed from :', stashedResponse.headers.get('X-Samizdat-Method'),
'\n+-- fetched using :', reqInfo.method,
'\n+-- fetched using :', response.headers.get('X-Samizdat-Method'),
'\n+-- stashed X-Samizdat-ETag :', stashedResponse.headers.get('X-Samizdat-ETag'),
'\n+-- fetched X-Samizdat-ETag :', response.headers.get('X-Samizdat-ETag'))
// if the method does not match, or if it matches but the ETag doesn't
// we have a different response
// which means *probably* fresher content
if ( ( stashedResponse.headers.get('X-Samizdat-Method') !== reqInfo.method )
if ( ( stashedResponse.headers.get('X-Samizdat-Method') !== response.headers.get('X-Samizdat-Method') )
|| ( stashedResponse.headers.get('X-Samizdat-ETag') !== response.headers.get('X-Samizdat-ETag') ) ) {
// inform!
console.log('(COMMIT_UNKNOWN) fetched version method or ETag differs from stashed for:', url)
......@@ -483,7 +483,7 @@ let getResourceThroughSamizdat = (request, clientId, useStashed=true, doStash=tr
// ok, now we're in business
console.log('(COMMIT_UNKNOWN) Stashing a successful fetch of:', url,
'\n+-- fetched using :', reqInfo.method,
'\n+-- fetched using :', response.headers.get('X-Samizdat-Method'),
'\n+-- stashing using :', SamizdatPlugins[i].name)
response.headers.forEach(function(v, k){
console.log('+-- Stashing header: ', k, ' :: ', v)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment