From 6b27df3dec32ad9b4f0aec2beb03bfa74a2d125e Mon Sep 17 00:00:00 2001 From: Elad Gil Date: Thu, 1 Dec 2016 16:12:46 +0200 Subject: [PATCH 1/2] pass source.options to the render function if the response uses a different layout than the default, it won't be rendered using it's preferred layout thus matching etags will be generated for changes that might have happen on the layout. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e8a2aa6..be774d3 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ internals.marshal = function (request, next) { return next(null, source); break; case 'view': - return request.server.render(source.template, source.context, function (err, rendered) { + return request.server.render(source.template, source.context, source.options, function (err, rendered) { if (err) { throw err; @@ -123,4 +123,4 @@ exports.register = function (server, options, next) { exports.register.attributes = { name: Package.name, version: Package.version -}; \ No newline at end of file +}; From 5a6a81286e0a98d1ccd8ca9e4e06ece3d5f35d87 Mon Sep 17 00:00:00 2001 From: Elad Gil Date: Thu, 1 Dec 2016 16:27:39 +0200 Subject: [PATCH 2/2] added Melatonin64 fix --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index be774d3..0a15538 100644 --- a/index.js +++ b/index.js @@ -53,7 +53,7 @@ internals.marshal = function (request, next) { return next(null, source); break; case 'view': - return request.server.render(source.template, source.context, source.options, function (err, rendered) { + return request.render(source.template, source.context, source.options, function (err, rendered) { if (err) { throw err;