aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBigRetroMike <bigretromike@users.noreply.github.com>2022-06-01 19:02:32 +0200
committerBigRetroMike <bigretromike@users.noreply.github.com>2022-06-04 15:51:33 +0200
commit8b1dcc6ea3b9ddc3bdd610a2359e4084b8ba353f (patch)
treea7afdb14ef393e6aef39ae2ec3e3428e436907d3
parent48f4849a544776cbbe8c29452ed4bef4e3359cae (diff)
downloadxbmc-8b1dcc6ea3b9ddc3bdd610a2359e4084b8ba353f.tar.xz
[backport] if Content-Length is found and its not text/html, URL is pointing to file so don't treat URL as HTTPDirectory;
-rw-r--r--xbmc/filesystem/HTTPDirectory.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/xbmc/filesystem/HTTPDirectory.cpp b/xbmc/filesystem/HTTPDirectory.cpp
index e9323bd1e4..89420b840c 100644
--- a/xbmc/filesystem/HTTPDirectory.cpp
+++ b/xbmc/filesystem/HTTPDirectory.cpp
@@ -71,6 +71,11 @@ bool CHTTPDirectory::GetDirectory(const CURL& url, CFileItemList &items)
std::string strBuffer;
if (http.ReadData(strBuffer) && strBuffer.length() > 0)
{
+ /* 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")
+ return false;
+
std::string fileCharset(http.GetProperty(XFILE::FILE_PROPERTY_CONTENT_CHARSET));
if (!fileCharset.empty() && fileCharset != "UTF-8")
{