Merge branch 'shtml-content-type' of github.com:birarda/hifi into near-grab-via-parenting

This commit is contained in:
Seth Alves 2015-12-17 10:49:52 -08:00
commit 5d8417309a

View file

@ -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;
}