mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:37:35 +02:00
Merge pull request #1435 from daleglass/fix-html-mime-type
Fix mime type for serving .htm and .html files with the embedded webserver.
This commit is contained in:
commit
457c622598
1 changed files with 31 additions and 30 deletions
|
@ -166,9 +166,10 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
|
|||
localFileData = localFileString.toLocal8Bit();
|
||||
}
|
||||
|
||||
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused
|
||||
// if this is an shtml, html or htm 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