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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user