Skip to content

Commit

Permalink
Merge 4fdff7c into dd5c0a6
Browse files Browse the repository at this point in the history
  • Loading branch information
Pchelolo committed Sep 26, 2018
2 parents dd5c0a6 + 4fdff7c commit 35c7a56
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/content_negotiation_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = (hyper, req, next, options, specInfo) => {
return htmlRes;
}

if (semver.satisfies(storedVersion, requestedVersion)) {
if (semver.satisfies(storedVersion, `^${requestedVersion}`)) {
// Nothing to do
return htmlRes;
}
Expand All @@ -60,6 +60,9 @@ module.exports = (hyper, req, next, options, specInfo) => {
.then((newRes) => {
const newVersion =
mwUtil.extractHTMLProfileVersion(newRes.headers['content-type']);
if (semver.satisfies(newVersion, `^${requestedVersion}`)) {
return newRes;
}
hyper.logger.log('error/negotiation', {
message: 'Failed to satisfy required version',
request: req,
Expand Down

0 comments on commit 35c7a56

Please sign in to comment.