aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Borges de Freitas <enen92@users.noreply.github.com>2022-06-24 19:40:39 +0100
committerGitHub <noreply@github.com>2022-06-24 19:40:39 +0100
commitd4f5d16c8d6c9b5e50bceb9be9ae34162b7f6615 (patch)
treea137837e1f96411a04be89da8d3cc6493f09136e
parentff2589a2942a3b677631b3eb4075f1c6fb2b5cc5 (diff)
parente9f587b8343dd1d8d63c46d68c877b822122c861 (diff)
Merge pull request #21594 from howie-f/v20-contenttype
[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")