File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -43,16 +43,19 @@ export class FastifyLoader extends AbstractLoader {
43
43
const renderFn = ( req : any , res : any ) => {
44
44
fs . stat ( indexFilePath , ( err ) => {
45
45
if ( err ) {
46
- const stream = fs . createReadStream ( indexFilePath ) ;
47
- if ( options . serveStaticOptions ?. setHeaders ) {
48
- const stat = fs . statSync ( indexFilePath ) ;
49
- options . serveStaticOptions . setHeaders ( res , indexFilePath , stat ) ;
50
- }
51
- res . type ( 'text/html' ) . send ( stream ) ;
52
- } else {
53
46
const error = new NotFoundException ( ) ;
54
47
res . status ( error . getStatus ( ) ) . send ( error . getResponse ( ) ) ;
48
+ return ;
55
49
}
50
+
51
+ const stream = fs . createReadStream ( indexFilePath ) ;
52
+
53
+ if ( options . serveStaticOptions ?. setHeaders ) {
54
+ const stat = fs . statSync ( indexFilePath ) ;
55
+ options . serveStaticOptions . setHeaders ( res , indexFilePath , stat ) ;
56
+ }
57
+
58
+ res . type ( 'text/html' ) . send ( stream ) ;
56
59
} ) ;
57
60
} ;
58
61
You can’t perform that action at this time.
0 commit comments