diff --git a/http-cache/cache_cache-control.js b/http-cache/cache_cache-control.js index 7b1bb1d..100a412 100644 --- a/http-cache/cache_cache-control.js +++ b/http-cache/cache_cache-control.js @@ -19,6 +19,11 @@ const path = require('path') http.createServer((req, res) => { + if (path.normalize(decodeURI(req.url)) !== decodeURI(req.url)) { + res.statusCode = 403; + res.end(); + return; + } let filePath = path.join(__dirname, req.url) fs.readFile(filePath, (err, data) => { if (err) {