2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-10-27 00:26:57 +00:00

chore: improve webview code style

This commit is contained in:
Jan Laupetin
2025-10-05 23:23:37 +01:00
parent cb2e83dfca
commit aa0134c341
7 changed files with 142 additions and 148 deletions

View File

@@ -13,3 +13,19 @@ std::unordered_map<std::string, UiFile> BuildUiFileLookup()
return result;
}
const char* GetMimeTypeForFileName(const std::string& fileName)
{
const char* mimeType;
if (fileName.ends_with(".html"))
mimeType = "text/html";
else if (fileName.ends_with(".js"))
mimeType = "text/javascript";
else if (fileName.ends_with(".css"))
mimeType = "text/css";
else
mimeType = "application/octet-stream";
return mimeType;
}