From e9f587b8343dd1d8d63c46d68c877b822122c861 Mon Sep 17 00:00:00 2001 From: howie-f Date: Fri, 24 Jun 2022 14:58:28 +0200 Subject: [content] http header: check if content-type starts with "text/html" --- xbmc/filesystem/HTTPDirectory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/filesystem/HTTPDirectory.cpp b/xbmc/filesystem/HTTPDirectory.cpp index a8049be030..0097b7f15c 100644 --- a/xbmc/filesystem/HTTPDirectory.cpp +++ b/xbmc/filesystem/HTTPDirectory.cpp @@ -77,8 +77,10 @@ bool CHTTPDirectory::GetDirectory(const CURL& url, CFileItemList &items) { /* if Content-Length is found and its not text/html, URL is pointing to file so don't treat URL as HTTPDirectory */ if (!http.GetHttpHeader().GetValue("Content-Length").empty() && - http.GetHttpHeader().GetValue("Content-type") != "text/html") + !StringUtils::StartsWithNoCase(http.GetHttpHeader().GetValue("Content-type"), "text/html")) + { return false; + } std::string fileCharset(http.GetProperty(XFILE::FILE_PROPERTY_CONTENT_CHARSET)); if (!fileCharset.empty() && fileCharset != "UTF-8") -- cgit v1.2.3