Chapter 9: Malicious input samples

This commit is contained in:
Beth Griggs
2020-09-06 05:07:09 +01:00
parent ddbc582176
commit 000c8dd1a7
4 changed files with 11 additions and 13 deletions
@@ -2,11 +2,11 @@ const express = require("express");
const app = express();
const escapeHTML = require("escape-html");
app.get("*", (req, res) => {
app.get("/", (req, res) => {
const { previous, lang, token } = req.query;
getServiceStatus((status) => {
const href = escapeHTML(`/${previous}${token}/${lang}`);
res.send(`
const href = escapeHTML(`/${previous}${token}/${lang}`);
res.send(`
<h1>Service Status</h1>
<div id=status>
${status}
@@ -26,4 +26,3 @@ getServiceStatus = (callback) => {
app.listen(3000, () => {
console.log("Server listening on port 3000");
});