wininet: Improve searching for no-store header in HTTP response.
This commit is contained in:
parent
c11da76dc5
commit
4c4a922e27
|
@ -2307,9 +2307,30 @@ static void create_cache_entry(http_request_t *req)
|
|||
|
||||
if(b) {
|
||||
int header_idx = HTTP_GetCustomHeaderIndex(req, szCache_Control, 0, FALSE);
|
||||
if(header_idx!=-1 && (!strcmpiW(req->custHeaders[header_idx].lpszValue, no_cacheW)
|
||||
|| !strcmpiW(req->custHeaders[header_idx].lpszValue, no_storeW)))
|
||||
b = FALSE;
|
||||
if(header_idx != -1) {
|
||||
WCHAR *ptr;
|
||||
|
||||
for(ptr=req->custHeaders[header_idx].lpszValue; *ptr; ) {
|
||||
WCHAR *end;
|
||||
|
||||
while(*ptr==' ' || *ptr=='\t')
|
||||
ptr++;
|
||||
|
||||
end = strchrW(ptr, ',');
|
||||
if(!end)
|
||||
end = ptr + strlenW(ptr);
|
||||
|
||||
if(!strncmpiW(ptr, no_cacheW, sizeof(no_cacheW)/sizeof(*no_cacheW)-1)
|
||||
|| !strncmpiW(ptr, no_storeW, sizeof(no_storeW)/sizeof(*no_storeW)-1)) {
|
||||
b = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
ptr = end;
|
||||
if(*ptr == ',')
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!b) {
|
||||
|
|
|
@ -2026,7 +2026,7 @@ static DWORD CALLBACK server_thread(LPVOID param)
|
|||
}
|
||||
if (strstr(buffer, "GET /test_cache_control_no_store"))
|
||||
{
|
||||
static const char no_cache_response[] = "HTTP/1.1 200 OK\r\nCache-Control: No-StOrE\r\n\r\nsome content";
|
||||
static const char no_cache_response[] = "HTTP/1.1 200 OK\r\nCache-Control: junk, \t No-StOrE\r\n\r\nsome content";
|
||||
send(c, no_cache_response, sizeof(no_cache_response)-1, 0);
|
||||
}
|
||||
if (strstr(buffer, "GET /test_premature_disconnect"))
|
||||
|
|
Loading…
Reference in New Issue