Skip to content

Commit

Permalink
If req.url was set to / it cause the links to think they were point…
Browse files Browse the repository at this point in the history
…ing to a different domain and the root urls would break.
  • Loading branch information
travisperson committed Sep 2, 2011
1 parent cf63eb7 commit 4515615
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vendor/node-static/lib/node-static.js
Expand Up @@ -247,7 +247,7 @@ this.Server.prototype.serveautoIndex = function (dirPath, res, req, finish) {
fs.readdir(dirPath, function(err, result) {
if (err) { return finish(404, {})}
result.forEach(function(v, i) {
html += ('<tr><td>' + '<a href="' + req.url + '/' + v + '">' + v + '</a></td></tr>');
html += ('<tr><td>' + '<a href="' + ((req.url == '/') ? '' : req.url) + '/' + v + '">' + v + '</a></td></tr>');
});
html += '</table>';
html += '\
Expand Down

0 comments on commit 4515615

Please sign in to comment.