jfhbrook / node-ecstatic

A static file server middleware that works with core http, express or on the CLI!
https://github.com/jfhbrook/node-ecstatic
MIT License
975 stars 194 forks source link

The <dir> folder in test/public is breaking git in Windows #172

Closed dotnetCarpenter closed 8 years ago

dotnetCarpenter commented 8 years ago

One can not have a folder named

in Windows, which prohibit me from cloning and updating my local copy of node-ecstatic. Can we called it something else, please?

On Windows the following characters are forbidden in a folder name; \ / < > | * ? " :

I currently can not checkout pull requests.

dotnetCarpenter commented 8 years ago

I found a way, using sparse checkout. After reading through the commit from @jre-g, I see that we can not rename the folder as the attack is only made possible when folders are named in a certain way, that is illegal on Windows.

I will make a PR to the README with the Windows work-around, to enable Windows users to clone and contribute to node-ecstatic.

jfhbrook commented 8 years ago

Thanks!

dotnetCarpenter commented 8 years ago

@jfhbrook well perhaps we could just create the <div> directory in the two unit tests and in them test if we're on Windows. If we are then skip the tests.

E.g. t.notMatch(body, /<dir>/, 'We didn\'t find the unencoded pathname', { skip: true});

I don't have time at the moment to do it, but if you do, I'll gladly test it.