toWebResponse function

Response toWebResponse(
  1. Response response
)

Spry response to web response object.

Implementation

web.Response toWebResponse(Response response) {
  final init = web.ResponseInit(
    status: response.status,
    statusText: response.statusText,
    headers: toWebHeaders(response.headers),
  );

  if (response.body == null) {
    return web.Response(null, init);
  }

  return web.Response(_toWebReadableStream(response.body!), init);
}