node-ecstatic
node-ecstatic copied to clipboard
Windows Infinite 302 Redirection
https://github.com/jfhbrook/node-ecstatic/blob/ae7a39b1ecdbe3aa8c0162ab2c3f7365bf9a6d75/lib/ecstatic.js#L23-L31
Windows pathname parsing is incorrect
https://github.com/jfhbrook/node-ecstatic/blob/ae7a39b1ecdbe3aa8c0162ab2c3f7365bf9a6d75/lib/ecstatic.js#L393-L399 Or modify here to
if (!parsed.pathname.match(/\/$/)) {
res.statusCode = 302;
const q = parsed.query ? `?${parsed.query}` : '';
res.setHeader('location', `${parsed.pathname}/${q}`);
res.end();
return;
}
Regressed in commit https://github.com/jfhbrook/node-ecstatic/commit/be6fc25a826f190b67f4d16158f9d67899e38ee4 which was also backported to 3.x series with https://github.com/jfhbrook/node-ecstatic/commit/d0e2bcf40e31d361f6cc419b4b5c2c7846e0dad6.