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:05:34 +0200
commit0a0f2a8f1a60c90fdb848f7e726fa252806a6367 (patch)
treee6cc27261bb6f311e7521bc9ff37af7fbeee8176
parent3631c43c4d3a2322413de79062d40689a384f873 (diff)
downloadxbmc-0a0f2a8f1a60c90fdb848f7e726fa252806a6367.tar.xz
[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 89420b840c..d2fabda7dc 100644
--- a/xbmc/filesystem/HTTPDirectory.cpp
+++ b/xbmc/filesystem/HTTPDirectory.cpp
@@ -73,8 +73,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")