mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-06 19:35:13 +02:00
11 lines
338 B
JavaScript
11 lines
338 B
JavaScript
// Unsafe: Handlebars.compile receives a template *source* string built from
|
|
// req.body. SSTI fires on the source argument.
|
|
const Handlebars = require('handlebars');
|
|
|
|
function handler(req, res) {
|
|
const tmpl = req.body.template;
|
|
const compiled = Handlebars.compile(tmpl);
|
|
res.send(compiled({}));
|
|
}
|
|
|
|
module.exports = handler;
|