aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhowie-f <rftc@gmx.de>2022-06-24 14:58:28 +0200
committerhowie-f <rftc@gmx.de>2022-06-24 15:04:58 +0200
commite9f587b8343dd1d8d63c46d68c877b822122c861 (patch)
treea137837e1f96411a04be89da8d3cc6493f09136e
parentff2589a2942a3b677631b3eb4075f1c6fb2b5cc5 (diff)
[content] http header: check if content-type starts with "text/html"
-rw-r--r--xbmc/filesystem/HTTPDirectory.cpp4
1 files changed, 3 insertions, 1 deletions
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")