Future<Response>
buildRawResponse(Response response)
Source
Future<shelf.Response> buildRawResponse(Response response) async {
await response.handle();
if (response.isEmpty) {
response.notFound();
}
if ((response.request.method.toLowerCase() == "options") &&
response.isEmpty) {
response.headers['Allow'] = response.acceptedMethods.join(', ');
response.headers['Content-Length'] = "0";
response.ok('');
}
return new shelf.Response(response.statusCode,
body: response.body, headers: response.headers);
}