hmpo-template-mixins
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -389,3 +389,3 @@ 'use strict'; | ||
url = Hogan.compile(url).render(this); | ||
return path.resolve(req.baseUrl, url); | ||
return req.baseUrl ? path.resolve(req.baseUrl, url) : url; | ||
}; | ||
@@ -392,0 +392,0 @@ }; |
{ | ||
"name": "hmpo-template-mixins", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "A middleware that exposes a series of Mustache mixins on res.locals to ease usage of forms, translations, and some general needs.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -976,2 +976,9 @@ var mixins = require('../lib/template-mixins'); | ||
it('returns path if baseUrl is not set', function () { | ||
req.baseUrl = undefined; | ||
middleware(req, res, next); | ||
res.locals.url().call(res.locals, 'path').should.equal('path'); | ||
res.locals.url().call(res.locals, './path').should.equal('./path'); | ||
}); | ||
it('does not prepend the baseUrl to absolute paths', function () { | ||
@@ -978,0 +985,0 @@ req.baseUrl = '/base'; |
64527
1202