[Issue#] LINUXWRT-983
[Problem] Some html files included in encryption widget are not encrypted after installation.
[Cause] wrt-installer decides target files of encryption by refering to each filename extension.
However, ".htm" was omitted in target list.
[Solution] Added new extension define, ".htm", for encryption.
Additionally, consideration of capital letter was also added.
Change-Id: If6efdf3f54ead6085631bdd37fec1e23ae10b7ee
#include <errno.h>
#include <cstdio>
#include <sstream>
#include <errno.h>
#include <cstdio>
#include <sstream>
+#include <iostream>
+#include <algorithm>
static std::set<std::string> encryptSet;
if (encryptSet.empty()) {
encryptSet.insert(".html");
static std::set<std::string> encryptSet;
if (encryptSet.empty()) {
encryptSet.insert(".html");
+ encryptSet.insert(".htm");
encryptSet.insert(".css");
encryptSet.insert(".js");
}
encryptSet.insert(".css");
encryptSet.insert(".js");
}
size_t foundKey = file.rfind(".");
if (std::string::npos != foundKey) {
std::string mimeType = file.substr(foundKey);
size_t foundKey = file.rfind(".");
if (std::string::npos != foundKey) {
std::string mimeType = file.substr(foundKey);
+ std::transform(mimeType.begin(), mimeType.end(), mimeType.begin(),
+ ::tolower);
+
return getSupportedForEncryption().count(mimeType) > 0;
}
return false;
return getSupportedForEncryption().count(mimeType) > 0;
}
return false;