mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
use a ternary for single assignment
This commit is contained in:
parent
286b984d6f
commit
08f42c08d9
1 changed files with 4 additions and 4 deletions
|
@ -147,10 +147,10 @@ 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
|
||||
auto mimeType = QString { "text/html" };
|
||||
if (localFileInfo.suffix() != "shtml") {
|
||||
mimeType = mimeDatabase.mimeTypeForFile(filePath).name();
|
||||
}
|
||||
// otherwise use the mimeDatabase to look it up
|
||||
auto mimeType = localFileInfo.suffix() == "shtml"
|
||||
? QString { "text/html" }
|
||||
: mimeDatabase.mimeTypeForFile(filePath).name();
|
||||
|
||||
connection->respond(HTTPConnection::StatusCode200, localFileData, qPrintable(mimeType));
|
||||
|
||||
|
|
Loading…
Reference in a new issue