对于包含content-range头部的http会话,不进行缓存查询和更新。

This commit is contained in:
zhengchao
2018-10-22 16:41:26 +08:00
committed by 陆秋文
parent 0d95a8e54e
commit 3109977ba7

View File

@@ -111,6 +111,10 @@ enum cache_pending_action tfe_cache_get_pending(const struct tfe_http_half *requ
int index = 0;
const char *value = NULL;
memset(restrict,0,sizeof(struct request_freshness));
if(NULL!=tfe_http_std_field_read(request, TFE_HTTP_CONT_RANGE))
{
return FORBIDDEN;
}
value = tfe_http_std_field_read(request, TFE_HTTP_PRAGMA);
if (value != NULL)
{
@@ -272,7 +276,8 @@ enum cache_pending_action tfe_cache_put_pending(const struct tfe_http_half *resp
int index = 0;
const char *value = NULL;
memset(freshness,0,sizeof(struct response_freshness));
if(response->resp_spec.resp_code!=TFE_HTTP_STATUS_OK)
if(response->resp_spec.resp_code!=TFE_HTTP_STATUS_OK
|| NULL!=tfe_http_std_field_read(response, TFE_HTTP_CONT_RANGE)) //NOT upload response with content-range
{
return FORBIDDEN;
}