mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 05:48:26 +02: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
|
// if this is an shtml file just make the MIME type match HTML so browsers aren't confused
|
||||||
auto mimeType = QString { "text/html" };
|
// otherwise use the mimeDatabase to look it up
|
||||||
if (localFileInfo.suffix() != "shtml") {
|
auto mimeType = localFileInfo.suffix() == "shtml"
|
||||||
mimeType = mimeDatabase.mimeTypeForFile(filePath).name();
|
? QString { "text/html" }
|
||||||
}
|
: mimeDatabase.mimeTypeForFile(filePath).name();
|
||||||
|
|
||||||
connection->respond(HTTPConnection::StatusCode200, localFileData, qPrintable(mimeType));
|
connection->respond(HTTPConnection::StatusCode200, localFileData, qPrintable(mimeType));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue