Skip to content

Commit

Permalink
Merge pull request heroku#5 from mohamedmansour/patch-1
Browse files Browse the repository at this point in the history
Fix dynamicHelpers so that it would resolve the urls.
  • Loading branch information
David Pio committed Jul 9, 2012
2 parents f0d3e57 + 83f2bde commit 0d21bdb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ app.dynamicHelpers({
return req.headers['host'];
},
'scheme': function(req, res) {
req.headers['x-forwarded-proto'] || 'http'
return req.headers['x-forwarded-proto'] || 'http';
},
'url': function(req, res) {
return function(path) {
return app.dynamicViewHelpers.scheme(req, res) + app.dynamicViewHelpers.url_no_scheme(path);
return app.dynamicViewHelpers.scheme(req, res) + app.dynamicViewHelpers.url_no_scheme(req, res)(path);
}
},
'url_no_scheme': function(req, res) {
return function(path) {
return '://' + app.dynamicViewHelpers.host(req, res) + path;
return '://' + app.dynamicViewHelpers.host(req, res) + (path || '');
}
},
});
Expand Down

0 comments on commit 0d21bdb

Please sign in to comment.