Skip to content

Commit

Permalink
Remove unnecessary context build when fileFound == null.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpassos committed Dec 5, 2023
1 parent 9c0e03c commit c449717
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkgs/shelf_static/lib/src/static_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ Handler createStaticHandler(String fileSystemPath,
}

if (fileFound == null) {
return Response.notFound(
'Not Found',
context: _buildResponseContext(fileNotFound: fileFound),
);
return Response.notFound('Not Found');
}

final file = fileFound;

if (!serveFilesOutsidePath) {
Expand Down

0 comments on commit c449717

Please sign in to comment.