Spaces in url fix

This commit is contained in:
MrFry 2019-10-24 15:20:00 +02:00
parent bca8fa097d
commit a7e014796a
2 changed files with 3 additions and 2 deletions

View file

@ -49,7 +49,8 @@ app.use(bodyParser.json({
// --------------------------------------------------------------
app.get('/*', function (req, res) {
let curr = listedFiles + '/' + req.url.substring('/'.length, req.url.length).split('?')[0]
let parsedUrl = req.url.replace(/%20/g, " ")
let curr = listedFiles + '/' + parsedUrl.substring('/'.length, parsedUrl.length).split('?')[0]
let relPath = curr.substring('./public/files'.length, curr.length)
if (relPath[relPath.length - 1] !== '/') { relPath += '/' }

View file

@ -65,7 +65,7 @@
<%=dirname%>
</h1>
</center>
<a href=<%= "http://stuff.frylabs.net" + prevDir%> > Up one level </a>
<a href="<%= "http://stuff.frylabs.net" + prevDir%>" > Up one level </a>
</p>
<table class="maintable">