New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When used on windows and node v0.10.26+ the isMalicious check always returns true #6
Comments
In JavaScript var path = 'c:\\windows\\system'; See this MDN article for reference. |
Yes, I called "escape character" a "delimiter" by mistake, thanks for correcting my terminology. However the bug still exists, were you able to take a look at my pull request? I ended up fixing the bug by replacing forward slashes with back slashes if the operating system is windows. if(/^win/i.test(process.platform)){ // if windows operating system
// fixes windows paths
docroot = docroot.replace(/\//gi,"\\");
} In my pull request I made 2 commits, after the first commit, I noticed the issues was still occurring when I specified a sub folder when using gateway directly with connect, by directly I mean not through a grunt task. So that is why I decided to change the approach to using find replace. |
Sorry, I didn't meant to correct your terminology. What I was trying to say is that things should already work if you escape the passed in string properly. If I understand your second commit correctly you want to be able to specify the docroot using a unix-like path (with forward slashes) on Windows too? |
Awesome plugin! I have found a bug on windows.
On Windows when using node >= v0.10.26, node will parse ['c:\mypath'] into 'c:\mypath'.
Example:
This results in your path.indexOf(docroot) to compare a delimited string with a non delimited string, thus always failing
I am going to do a pull request with this simple fix, create an array with docroot and get the string out of the array :
The text was updated successfully, but these errors were encountered: