decode req.path

This commit is contained in:
Rich Harris
2018-09-03 09:01:11 -04:00
parent 611237e393
commit ba7bcde600

View File

@@ -8,7 +8,7 @@ posts.forEach(post => {
export function get(req, res, next) {
// the `slug` parameter is available because
// this file is called [slug].json.js
const { slug } = req.params;
const slug = decodeURIComponent(req.params.slug);
if (lookup.has(slug)) {
res.writeHead(200, {