зеркало из https://github.com/github/codeql.git
ssti updated
This commit is contained in:
Родитель
68b57502f9
Коммит
895aa622bf
|
@ -0,0 +1,39 @@
|
|||
const express = require('express')
|
||||
var bodyParser = require('body-parser');
|
||||
const app = express()
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
//Dependent of Templating engine
|
||||
var jade = require('pug');
|
||||
const port = 5061
|
||||
|
||||
function getHTML(input) {
|
||||
var template = `
|
||||
doctype
|
||||
html
|
||||
head
|
||||
title= 'Hello world'
|
||||
body
|
||||
form(action='/' method='post')
|
||||
label(for='name') Name:
|
||||
input#name.form-control(type='text', placeholder='' name='name')
|
||||
button.btn.btn-primary(type='submit') Submit
|
||||
p Hello #{username}`
|
||||
var fn = jade.compile(template);
|
||||
var html = fn({username: input});
|
||||
console.log(html);
|
||||
return html;
|
||||
}
|
||||
|
||||
app.post('/', (request, response) => {
|
||||
var input = request.param('name', "")
|
||||
var html = getHTML(input)
|
||||
response.send(html);
|
||||
})
|
||||
|
||||
app.listen(port, (err) => {
|
||||
if (err) {
|
||||
return console.log('something bad happened', err)
|
||||
}
|
||||
console.log(`server is listening on ${port}`)
|
||||
})
|
Загрузка…
Ссылка в новой задаче