Skip to content

Commit be6fc25

Browse files
committed
Ho hum
1 parent fab5945 commit be6fc25

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/ecstatic.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ let ecstatic = null;
2020
function decodePathname(pathname) {
2121
const pieces = pathname.replace(/\\/g, '/').split('/');
2222

23-
return pieces.map((rawPiece) => {
23+
return path.normalize(pieces.map((rawPiece) => {
2424
const piece = decodeURIComponent(rawPiece);
2525

2626
if (process.platform === 'win32' && /\\/.test(piece)) {
2727
throw new Error('Invalid forward slash character');
2828
}
2929

3030
return piece;
31-
}).join('/');
31+
}).join('/'));
3232
}
3333

3434

@@ -388,8 +388,9 @@ module.exports = function createMiddleware(_dir, _options) {
388388
return;
389389
}
390390

391+
391392
// 302 to / if necessary
392-
if (!parsed.pathname.match(/\/$/)) {
393+
if (!pathname.match(/\/$/)) {
393394
res.statusCode = 302;
394395
const q = parsed.query ? `?${parsed.query}` : '';
395396
res.setHeader('location', `${parsed.pathname}/${q}`);

0 commit comments

Comments
 (0)