tor) {
    int pos = date.indexOf(separator, index);
    if (pos - index != 3) throw new HttpException(&quot;Invalid HTTP date $date&quot;);
    tmp = date.substring(index, pos);
    index = pos + 1;
    int month = months.indexOf(tmp);
    if (month != -1) return month;
    throw new HttpException(&quot;Invalid HTTP date $date&quot;);
  }

  int expectNum(String separator) {
    int pos;
    if (separator.length &gt; 0) {
      pos = date.indexOf(separator, index);
    } else {
      pos = date.length;
   