mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 15:47:02 +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();
|
localFileData = localFileString.toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
|
||||||
connection->respond(HTTPConnection::StatusCode200, localFileData,
|
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused
|
||||||
qPrintable(mimeDatabase.mimeTypeForFile(filePath).name()));
|
auto mimeType = QString { "text/html" };
|
||||||
|
if (localFileInfo.suffix() != "shtml") {
|
||||||
|
mimeType = mimeDatabase.mimeTypeForFile(filePath).name();
|
||||||
|
}
|
||||||
|
|
||||||
|
connection->respond(HTTPConnection::StatusCode200, localFileData, qPrintable(mimeType));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue