Files
codeql/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXssGood2.js
2018-08-02 17:53:23 +01:00

12 lines
298 B
JavaScript

const url = require("url");
require("http").createServer(function(req, resp) {
var target = url.parse(req.url, true);
sendTextResponse(resp, target.pathname)
});
function sendTextResponse(resp, text) {
resp.writeHead(200, {"content-type": "text/plain; charset=utf-8"});
resp.end(text);
}