Skip to content

Commit

Permalink
Merge 2e2e8b0 into bd0072a
Browse files Browse the repository at this point in the history
  • Loading branch information
d00rman committed Oct 15, 2019
2 parents bd0072a + 2e2e8b0 commit a75275e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion sys/parsoid.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,24 @@ class ParsoidService {
contentPromise = P.resolve(undefined);
} else {
if (etag && etag.suffix === 'stash' && from === 'html' && to === 'wikitext') {
// T235465: RB should trust its own ETag over the client-supplied revision, but
// allow for the client to be right, so provide their revision as a fall-back
const revMismatch = etag.rev !== rp.revision;
if (revMismatch) {
// the ETag and URI parameter do not agree, log this (for now?)
hyper.logger.log('warn/parsoid/etag_rev', {
msg: 'The revisions in If-Match and URI differ'
});
}
contentPromise = this._getStashedContent(hyper, rp.domain,
rp.title, rp.revision, tid);
rp.title, etag.rev, etag.tid)
.catch({ status: 404 }, (e) => {
if (!revMismatch) {
// the revisions match, so this is a genuine 404
throw e;
}
return this._getStashedContent(hyper, rp.domain, rp.title, rp.revision, tid);
});
} else {
contentPromise = this._getOriginalContent(hyper, req, rp.revision, tid);
}
Expand Down

0 comments on commit a75275e

Please sign in to comment.