call method
Handle a spry request.
Implementation
Future<void> call(Context context) async {
final String? path = _resolvePath(context);
final File? file = _resolveFile(path);
if (file == null) {
throw SpryHttpException.notFound();
}
// Read file headers
final List<int> headers =
await file.openRead(0, 256).toList().then((value) => value.first);
final String mimeType = lookupMimeType(file.path, headerBytes: headers) ??
ContentType.binary.mimeType;
final ContentType contentType = ContentType.parse(mimeType);
final Response response = context.response;
response.contentType = contentType;
response.stream(file.openRead());
}