protected function parseMimeType($path, array $headers)
    {
        if (isset($headers['content-type'])) {
            list($mimetype) = explode(';', $headers['content-type'], 2);

            return trim($mimetype);
        }

        // Remove any query strings or fragments.
        list($path) = explode('#', $path, 2);
        list($path) = explode('?', $path, 2);

        return MimeType::detectByFilename($path);
    }
protected function parseMimeType($path, array $headers)
    {
        if (isset($headers['content-type'])) {
            list($mimetype) = explode(';', $headers['content-type'], 2);

            return trim($mimetype);
        }

        // Remove any query strings or fragments.
        list($path) = explode('#', $path, 2);
        list($path) = explode('?', $path, 2);

        return MimeType::detectByFilename($path);
    }
protected function parseMimeType ( $ path , array $ headers ) { if ( isset ( $ headers [ 'content-type' ] ) ) { list ( $ mimetype ) = explode ( ';' , $ headers [ 'content-type' ] , 2 ) ; return trim ( $ mimetype ) ; } // Remove any query strings or fragments. list ( $ path ) = explode ( '#' , $ path , 2 ) ; list ( $ path ) = explode ( '?' , $ path , 2 ) ; return MimeType :: detectByFilename ( $ path ) ; }
Parses the mimetype out of response headers.

@param string $path
@param array  $headers

@return string
Parses the mimetype out of response headers .