| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library shelf_static.static_handler; | |
| 6 | |
| 7 import 'dart:io'; | 5 import 'dart:io'; |
| 8 | 6 |
| 9 import 'package:http_parser/http_parser.dart'; | 7 import 'package:http_parser/http_parser.dart'; |
| 10 import 'package:mime/mime.dart' as mime; | 8 import 'package:mime/mime.dart' as mime; |
| 11 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
| 12 import 'package:shelf/shelf.dart'; | 10 import 'package:shelf/shelf.dart'; |
| 13 | 11 |
| 14 import 'directory_listing.dart'; | 12 import 'directory_listing.dart'; |
| 15 import 'util.dart'; | 13 import 'util.dart'; |
| 16 | 14 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 var filePath = p.join(dirPath, defaultFile); | 127 var filePath = p.join(dirPath, defaultFile); |
| 130 | 128 |
| 131 var file = new File(filePath); | 129 var file = new File(filePath); |
| 132 | 130 |
| 133 if (file.existsSync()) { | 131 if (file.existsSync()) { |
| 134 return file; | 132 return file; |
| 135 } | 133 } |
| 136 | 134 |
| 137 return null; | 135 return null; |
| 138 } | 136 } |
| OLD | NEW |