public function headerCallback($resource, $string)
    {
        if (!strpos($string, ':')) {
            return strlen($string);
        }

        list($name, $value) = array_map('trim', explode(':', $string, 2));

        $name = strtolower($name);

        if (!isset($this->headers[$name])) {
            $this->headers[$name] = [];
        }

        $this->headers[$name][] = $value;

        if ($this->onHeader === null || call_user_func($this->onHeader, $name, $value, $this->data) !== false) {
            return strlen($string);
        }

        return -1;
    }