<commit_before>library redstone.src.http_mock;

//copied from http_server/test/http_mock.dart

import 'dart:io';
import 'dart:collection';
import 'dart:async';
import 'dart:convert';

class MockHttpHeaders implements HttpHeaders {
  final Map<String, List<String>> _headers =
      new HashMap<String, List<String>>();

  ContentType _contentType;

  MockHttpHeaders([Map<String, List<String>> values]) {
    if (values != null) {
      _headers.addAll(values);
    }
  }

  List<String> operator [](String name) => _headers[name.toLowerCase()];

  DateTime get ifModifiedSince {
    List<String> values = _headers[HttpHeaders.IF_MODIFIED_SINCE];
    if (values != null) {
      try {
        return HttpDate.parse(values[0]);
      } on Exception {
        return null;
      }
    }
    return null;<commit_msg>Fix tests with last Shelf version (#194)<commit_after>library redstone.src.http_mock;

//copied from http_server/test/http_mock.dart

import 'dart:io';
import 'dart:collection';
import 'dart:async';
import 'dart:convert';

class MockHttpHeaders implements HttpHeaders {
  final Map<String, List<String>> _headers =
      new HashMap<String, List<String>>();

  ContentType _contentType;

  bool chunkedTransferEncoding;

  MockHttpHeaders([Map<String, List<String>> values]) {
    if (values != null) {
      _headers.addAll(values);
    }
  }

  List<String> operator [](String name) => _headers[name.toLowerCase()];

  DateTime get ifModifiedSince {
    List<String> values = _headers[HttpHeaders.IF_MODIFIED_SINCE];
    if (values != null) {
      try {
        return HttpDate.parse(values[0]);
      } on Exception {
        return null;
      }
    }
    return null;
{'fraction_non_alphanumeric': 0.1257413997627521, 'fraction_numerical': 0.0029655990510083037, 'mean_word_length': 3.7387640449438204, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2845370', 'n_tokens_mistral': 540, 'n_tokens_neox': 529, 'n_words': 119}