File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ var ecstatic = module.exports = function (dir, options) {
144
144
}
145
145
146
146
// 302 to / if necessary
147
- if ( ! parsed . pathname . match ( / \/ $ / ) ) {
147
+ if ( ! pathname . match ( / \/ $ / ) ) {
148
148
res . statusCode = 302 ;
149
149
res . setHeader ( 'location' , parsed . pathname + '/' +
150
150
( parsed . query ? ( '?' + parsed . query ) :'' )
@@ -384,15 +384,15 @@ function shouldCompress(req) {
384
384
function decodePathname ( pathname ) {
385
385
var pieces = pathname . replace ( / \\ / g, "/" ) . split ( '/' ) ;
386
386
387
- return pieces . map ( function ( piece ) {
387
+ return path . normalize ( pieces . map ( function ( piece ) {
388
388
piece = decodeURIComponent ( piece ) ;
389
389
390
390
if ( process . platform === 'win32' && / \\ / . test ( piece ) ) {
391
391
throw new Error ( 'Invalid forward slash character' ) ;
392
392
}
393
393
394
394
return piece ;
395
- } ) . join ( '/' ) ;
395
+ } ) . join ( '/' ) ) ;
396
396
}
397
397
398
398
if ( ! module . parent ) {
You can’t perform that action at this time.
0 commit comments