cookies property

Map<String, String> cookies
latefinal

Unmodifiable view of the cookies sent with the request.

Implementation

late final Map<String, String> cookies = () {
  if (request.headers[HttpHeaders.cookieHeader]?.expand((h) => h.split(';')) case final cookies?) {
    return UnmodifiableMapView({
      for (final cookie in cookies.map((cookie) => Cookie.fromSetCookieValue(cookie.trim())))
        cookie.name: cookie.value,
    });
  } else {
    return const <String, String>{};
  }
}();