static bool CompareUri(const std::string& info_uri,
const std::string& request_uri) {
+ if (info_uri == "*")
+ return true;
+
if (request_uri.empty())
return info_uri.empty();
bool prefix_wild = false;
bool suffix_wild = false;
std::string a_domain = a_domain_info.domain();
- if (utils::StartsWith(a_domain, "*.")) {
+ if (utils::StartsWith(a_domain, "*")) {
prefix_wild = true;
// *.domain.com -> .domain.com
a_domain = a_domain.substr(1);
}
- if (utils::EndsWith(a_domain, ".*")) {
+ if (utils::EndsWith(a_domain, "*")) {
suffix_wild = true;
// domain.* -> domain.
a_domain = a_domain.substr(0, a_domain.length() - 1);
int decrypted_size = 0;
do {
- unsigned char get_dec_size[4];
+ unsigned char get_dec_size[5];
memset(get_dec_size, 0x00, sizeof(get_dec_size));
size_t read_size =
- fread(get_dec_size, sizeof(unsigned char), sizeof(get_dec_size), src);
+ fread(get_dec_size, 1, 4, src);
if (0 != read_size) {
unsigned int read_buf_size = 0;
std::istringstream(std::string((char*)get_dec_size)) >> read_buf_size;
in_chunk.reset(new unsigned char[read_buf_size]);
size_t dec_read_size =
- fread(in_chunk.get(), sizeof(unsigned char), read_buf_size, src);
+ fread(in_chunk.get(), 1, read_buf_size, src);
if (0 != dec_read_size) {
unsigned char* decrypted_data = nullptr;
size_t decrypted_len = 0;