cloudhead/node-static — Issue #42: node-static win32 forbiden
Author: dacow
Created: 2011-12-30 01:48:25+00:00
State: open

using node + node-static on winxp and setting
var fileServer = new nstatic.Server("C:/public");
gave me an error everytime i tried to acces the localhost:8080 expecting to load the index.html

error comes from this line in node-static.js

this.Server.prototype.servePath = function (pathname, status, headers, req, res, finish)
......
// Make sure we're not trying to access a file outside of the root.
if (new(RegExp)('^' + that.root).test(pathname)) {

in that regex, pathname was C:\public and that.root = C:\public too.

so while in development (i dont have to worry bout someone trying to acces another files)
i comented this line and now is working fine

sorry for my english