mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
fix parsing of invalid syntax max-age value Cache-control header
This commit is contained in:
parent
24590a1145
commit
e598dcd139
@ -601,13 +601,18 @@ llcache_fetch_parse_cache_control(llcache_object *object, char *value)
|
||||
object->cache.no_cache = LLCACHE_VALIDATE_ALWAYS;
|
||||
} else if ((7 < comma - start) &&
|
||||
strncasecmp(start, "max-age", 7) == 0) {
|
||||
start += 7; /* skip max-age */
|
||||
|
||||
/* Find '=' */
|
||||
while (start < comma && *start != '=') {
|
||||
start++;
|
||||
}
|
||||
|
||||
/* Skip over it */
|
||||
start++;
|
||||
if (start < comma) {
|
||||
/* Skip over '=' */
|
||||
start++;
|
||||
}
|
||||
|
||||
|
||||
#define SKIP_ST(p) while (*p != '\0' && (*p == ' ' || *p == '\t')) p++
|
||||
|
||||
@ -616,6 +621,7 @@ llcache_fetch_parse_cache_control(llcache_object *object, char *value)
|
||||
|
||||
if (start < comma) {
|
||||
object->cache.max_age = atoi(start);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user