Skip to content

Commit

Permalink
Merge pull request #47 from benbp/template-contents
Browse files Browse the repository at this point in the history
Get 'contents' key from template objects
  • Loading branch information
yyscamper committed Aug 1, 2016
2 parents cb584c9 + ce9f87b commit 24a2e1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function TftpServerFactory(
template: req.file,
remoteAddress: req.stats.remoteAddress,
});
var script = ejs.render(this.templates[req.file].toString(), this.renderContext);
var script = ejs.render(this.templates[req.file].contents.toString(), this.renderContext);
res.setSize(script.length);
res.end(script);
} else {
Expand Down
5 changes: 4 additions & 1 deletion spec/lib/server-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ describe('tftp server tests', function () {
end: sinon.stub()
};
server.templates = {
test: '<%=switchProfileUri%> <%=switchProfileErrorUri%>'
test: {
contents: '<%=switchProfileUri%> <%=switchProfileErrorUri%>',
path: 'testpath'
}
};

server.requestWrapper(req, res);
Expand Down

0 comments on commit 24a2e1f

Please sign in to comment.