From 0405496913ab51196ed36806db1b5d4b0b8cd3bd Mon Sep 17 00:00:00 2001 From: nikaera Date: Sat, 9 May 2020 11:37:23 +0900 Subject: [PATCH] Percent-encoding of non-ASCII strings I added encodeURI because I would like to use it even if the article contains a non-ASCII string. --- backend/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app.js b/backend/app.js index 181ddf8..88c393d 100644 --- a/backend/app.js +++ b/backend/app.js @@ -6,7 +6,7 @@ const app = express() app.use(cors()) app.get('/', (req, res) => { - const url = 'https://' + req.query.url + const url = 'https://' + encodeURI(req.query.url) createTOC(url) .then(results => { res.send({ @@ -22,4 +22,4 @@ app.get('/', (req, res) => { app.listen(process.env.PORT || 8080, () => { console.log('Server Started') -}) \ No newline at end of file +})