mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 00:30:52 +02:00
Fix mime type for .htm and .html files
The code forces text/html for .shtml files, but if .html ones were used, it would look up in the mime database and come up with application/x-extension-html Web browsers try downloading that instead of rendering it.
This commit is contained in:
parent
61367ffd47
commit
5759c76154
1 changed files with 30 additions and 29 deletions
|
@ -168,7 +168,8 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
|
|||
|
||||
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused
|
||||
// otherwise use the mimeDatabase to look it up
|
||||
auto mimeType = localFileInfo.suffix() == "shtml"
|
||||
auto suffix = localFileInfo.suffix();
|
||||
auto mimeType = (suffix == "shtml" || suffix == "html" || suffix == "htm")
|
||||
? QString { "text/html" }
|
||||
: mimeDatabase.mimeTypeForFile(filePath).name();
|
||||
|
||||
|
|
Loading…
Reference in a new issue