diff --git a/routes/articles.js b/routes/articles.js index 5ffbe72..4cc734a 100644 --- a/routes/articles.js +++ b/routes/articles.js @@ -24,7 +24,7 @@ ${contents} } function articles_item(request, response) { - var article = fs.readFileSync('./articles/' + decodeURIComponent(request.params.item)); + var article = fs.readFileSync('./articles/' + request.params.item); response.send(`20 text/gemini\r\n ${article} diff --git a/uplink-gemini/lib/request.js b/uplink-gemini/lib/request.js index ac0a3c6..47fbc8c 100644 --- a/uplink-gemini/lib/request.js +++ b/uplink-gemini/lib/request.js @@ -42,7 +42,7 @@ module.exports = class Request { this.protocol = geminiUrl.protocol; this.hostname = geminiUrl.hostname; if (geminiUrl.port) this.port = geminiUrl.port; - this.path = geminiUrl.pathname; + this.path = decodeURIComponent(geminiUrl.pathname); this.search = geminiUrl.search.substring(1); //remove '?' from string if(this.protocol === 'titan:') { this.content = this.rawRequest.slice(this.rawRequest.indexOf('\r\n') + 3);