@@ -34,7 +34,7 @@ module.exports.mime = send.mime
3434 * @public
3535 */
3636
37- function serveStatic ( root , options ) {
37+ function serveStatic ( root , options ) {
3838 if ( ! root ) {
3939 throw new TypeError ( 'root path required' )
4040 }
@@ -68,7 +68,7 @@ function serveStatic(root, options) {
6868 ? createRedirectDirectoryListener ( )
6969 : createNotFoundDirectoryListener ( )
7070
71- return function serveStatic ( req , res , next ) {
71+ return function serveStatic ( req , res , next ) {
7272 if ( req . method !== 'GET' && req . method !== 'HEAD' ) {
7373 if ( fallthrough ) {
7474 return next ( )
@@ -104,14 +104,14 @@ function serveStatic(root, options) {
104104
105105 // add file listener for fallthrough
106106 if ( fallthrough ) {
107- stream . on ( 'file' , function onFile ( ) {
107+ stream . on ( 'file' , function onFile ( ) {
108108 // once file is determined, always forward error
109109 forwardError = true
110110 } )
111111 }
112112
113113 // forward errors
114- stream . on ( 'error' , function error ( err ) {
114+ stream . on ( 'error' , function error ( err ) {
115115 if ( forwardError || ! ( err . statusCode < 500 ) ) {
116116 next ( err )
117117 return
@@ -129,7 +129,7 @@ function serveStatic(root, options) {
129129 * Collapse all leading slashes into a single slash
130130 * @private
131131 */
132- function collapseLeadingSlashes ( str ) {
132+ function collapseLeadingSlashes ( str ) {
133133 for ( var i = 0 ; i < str . length ; i ++ ) {
134134 if ( str [ i ] !== '/' ) {
135135 break
@@ -146,8 +146,8 @@ function collapseLeadingSlashes(str) {
146146 * @private
147147 */
148148
149- function createNotFoundDirectoryListener ( ) {
150- return function notFound ( ) {
149+ function createNotFoundDirectoryListener ( ) {
150+ return function notFound ( ) {
151151 this . error ( 404 )
152152 }
153153}
@@ -157,8 +157,8 @@ function createNotFoundDirectoryListener() {
157157 * @private
158158 */
159159
160- function createRedirectDirectoryListener ( ) {
161- return function redirect ( ) {
160+ function createRedirectDirectoryListener ( ) {
161+ return function redirect ( ) {
162162 if ( this . hasTrailingSlash ( ) ) {
163163 this . error ( 404 )
164164 return
0 commit comments