diff options
author | Miguel Borges de Freitas <enen92@users.noreply.github.com> | 2022-06-08 14:40:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 14:40:54 +0100 |
commit | fa7a5ddab1cb04ef0973463680d7abfac85c997b (patch) | |
tree | a7afdb14ef393e6aef39ae2ec3e3428e436907d3 | |
parent | 48f4849a544776cbbe8c29452ed4bef4e3359cae (diff) | |
parent | 8b1dcc6ea3b9ddc3bdd610a2359e4084b8ba353f (diff) | |
download | xbmc-fa7a5ddab1cb04ef0973463680d7abfac85c997b.tar.xz |
Merge pull request #21503 from bigretromike/handle_binary_url_based_on_header
[backport] Proper handle Content-Type from http url that point to bin…
-rw-r--r-- | xbmc/filesystem/HTTPDirectory.cpp | 5 |
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") { |