Fix url decoding of path parameters.

This commit is contained in:
Matjaz
2022-01-08 21:40:45 +01:00
parent cf3dd31ec3
commit 7095ac7a46

View File

@ -42,7 +42,7 @@ module.exports = class Request {
this.protocol = geminiUrl.protocol; this.protocol = geminiUrl.protocol;
this.hostname = geminiUrl.hostname; this.hostname = geminiUrl.hostname;
if (geminiUrl.port) this.port = geminiUrl.port; 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 this.search = geminiUrl.search.substring(1); //remove '?' from string
if(this.protocol === 'titan:') { if(this.protocol === 'titan:') {
this.content = this.rawRequest.slice(this.rawRequest.indexOf('\r\n') + 3); this.content = this.rawRequest.slice(this.rawRequest.indexOf('\r\n') + 3);