File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ module.exports = function (dir, opts={}) {
47
47
48
48
if ( opts . dev ) {
49
49
return function ( req , res , next ) {
50
- let uri = req . path || req . pathname || parser ( req ) . pathname ;
50
+ let uri = decodeURIComponent ( req . path || req . pathname || parser ( req ) . pathname ) ;
51
51
let arr = uri . includes ( '.' ) ? [ uri ] : toAssume ( uri , extensions ) ;
52
52
let file = arr . map ( x => join ( dir , x ) ) . find ( fs . existsSync ) ;
53
53
if ( ! file ) return next ? next ( ) : notFound ( res ) ;
@@ -76,7 +76,7 @@ module.exports = function (dir, opts={}) {
76
76
} ) ;
77
77
78
78
return function ( req , res , next ) {
79
- let pathname = req . path || req . pathname || parser ( req ) . pathname ;
79
+ let pathname = decodeURIComponent ( req . path || req . pathname || parser ( req ) . pathname ) ;
80
80
let data = find ( pathname , extensions ) ;
81
81
if ( ! data ) return next ? next ( ) : notFound ( res ) ;
82
82
You can’t perform that action at this time.
0 commit comments