public function accepts()
    {
        $accepts = $this->hasHeader('Accept') ? $this->getHeader('Accept') : ['text/html'];

        foreach ($accepts as $i => $value) {
            list($mime, $q) = preg_split('/;\s*q\s*=\s*/', $value, 2) + [$value, 1.0];
            $stars = substr_count($mime, '*');
            $score = $stars ? (0.03 - $stars * 0.01) : $q;
            $score = $score * 100000 + strlen($mime); //RFC 4288 assumes a max length of 127/127 = 255 chars for mime.
            $preferences[$score][strtolower(trim($mime))] = (float) $q;
        }
        krsort($preferences);
        $preferences = call_user_func_array('array_merge', $preferences);
        return $preferences;
    }