protected function fetchHeaders($file) {
    $buffer = array();
    while ($header = fgets($file)) {
      $header = trim($header);
      if ($header == 'HTTP/1.1 100 Continue') {
        // Obey the command.
        continue;
      }
      if (!empty($header)) {
        $buffer[] = $header;
      }
    }
    return $buffer;
  }