diff --git a/cache/src/tango_cache_pending.cpp b/cache/src/tango_cache_pending.cpp index 2a5d928..22a42b3 100644 --- a/cache/src/tango_cache_pending.cpp +++ b/cache/src/tango_cache_pending.cpp @@ -148,7 +148,7 @@ time_t absolute_to_relative_time(const char* gmt_time) bool is_standard_gmt_format(const char* value) { int str_len = strlen(value); - if ((value[str_len - 1] == 'T') && (value[str_len - 2] == 'M') && (value[str_len - 3] == 'G')) + if(0==strcasecmp(value+str_len-3,"GMT")) { return true; } @@ -215,9 +215,8 @@ void get_response_freshness(const struct tfe_http_half *response, struct respons else { field_value = tfe_http_std_field_read(response, TFE_HTTP_EXPIRES); - if (field_value != NULL) + if (field_value != NULL && is_standard_gmt_format(field_value)) { - assert(is_standard_gmt_format(field_value)); expire_rel_time = absolute_to_relative_time(field_value); const time_t cur_ct_time = time(NULL); if (gmtime_r(&cur_ct_time, &cur_gmt_time) == NULL)