|
|
|
|
@ -86,8 +86,8 @@ string loadCustomTemplate (string customIndexPath) {
|
|
|
|
|
customIndexPath = kiwix::isRelativePath(customIndexPath) ?
|
|
|
|
|
kiwix::computeAbsolutePath(kiwix::getCurrentDirectory(), customIndexPath) :
|
|
|
|
|
customIndexPath;
|
|
|
|
|
if (!kiwix::fileExists(customIndexPath)) {
|
|
|
|
|
throw runtime_error("No such file exist (or file is not readable)" + customIndexPath);
|
|
|
|
|
if (!kiwix::fileReadable(customIndexPath)) {
|
|
|
|
|
throw runtime_error("No such file exist (or file is not readable) " + customIndexPath);
|
|
|
|
|
}
|
|
|
|
|
if (kiwix::getMimeTypeForFile(customIndexPath) != "text/html") {
|
|
|
|
|
throw runtime_error("Invalid File Mime Type " + kiwix::getMimeTypeForFile(customIndexPath));
|
|
|
|
|
|