public function headers() {
    $headers = array();
    $readers = array();
    $writers = array();

    // Create the rule strings. We need two copies, one for READ and
    // one for WRITE.
    foreach ($this->rules as $rule) {
      // We generate read and write rules separately so that the
      // generation logic has a chance to respond to the differences
      // allowances for READ and WRITE ACLs.
      if (self::READ & $rule['mask']) {
        $ruleStr = $this->ruleToString(self::READ, $rule);
        if (!empty($ruleStr)) {
          $readers[] = $ruleStr;
        }
      }
      if (self::WRITE & $rule['mask']) {
        $ruleStr = $this->ruleToString(self::WRITE, $rule);
        if (!empty($ruleStr)) {
          $writers[] = $ruleStr;
        }
      }
    }

    // Create the HTTP headers.
    if (!empty($readers)) {
      $headers[self::HEADER_READ] = implode(',', $readers);
    }
    if (!empty($writers)) {
      $headers[self::HEADER_WRITE] = implode(',', $writers);
    }

    return $headers;
  }