express-dust
express-dust copied to clipboard
Fix for Dust path evaluation when used with Express >=2.5.9
Originally opened by @totherik against davglass/express-dust with a proposed fix
It may be broken in earlier versions, too, but in Express 2.5.9 res.locals isn't an object reference, but instead a getter. The action of pushing the getter method onto the context created a subtle bug where standard replacements worked, but paths did not. e.g. {foo} works, {foo.bar} fails.
The suggested fix should be backward compatible.