HttpxCacheControl.fromHeaderValues constructor

HttpxCacheControl.fromHeaderValues(
  1. HttpxHeaderValues headerValues
)

Implementation

factory HttpxCacheControl.fromHeaderValues(HttpxHeaderValues headerValues) {
  final entries = headerValues.expand<MapEntry<String, String?>>((e) {
    final tmp = e.split('=');

    return [
      MapEntry(tmp.first, tmp.length > 1 ? tmp.skip(1).join('=') : null),
    ];
  });

  return HttpxCacheControl.fromMap(Map<String, String?>.fromEntries(entries));
}