mirror of
https://github.com/overte-org/overte.git
synced 2025-04-07 12:53:44 +02:00
serve SHTML files with HTML MIME type
This commit is contained in:
parent
40272faa3f
commit
286b984d6f
1 changed files with 8 additions and 3 deletions
|
@ -145,9 +145,14 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QUrl& url,
|
|||
|
||||
localFileData = localFileString.toLocal8Bit();
|
||||
}
|
||||
|
||||
connection->respond(HTTPConnection::StatusCode200, localFileData,
|
||||
qPrintable(mimeDatabase.mimeTypeForFile(filePath).name()));
|
||||
|
||||
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused
|
||||
auto mimeType = QString { "text/html" };
|
||||
if (localFileInfo.suffix() != "shtml") {
|
||||
mimeType = mimeDatabase.mimeTypeForFile(filePath).name();
|
||||
}
|
||||
|
||||
connection->respond(HTTPConnection::StatusCode200, localFileData, qPrintable(mimeType));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue