mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +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;
|
object->cache.no_cache = LLCACHE_VALIDATE_ALWAYS;
|
||||||
} else if ((7 < comma - start) &&
|
} else if ((7 < comma - start) &&
|
||||||
strncasecmp(start, "max-age", 7) == 0) {
|
strncasecmp(start, "max-age", 7) == 0) {
|
||||||
|
start += 7; /* skip max-age */
|
||||||
|
|
||||||
/* Find '=' */
|
/* Find '=' */
|
||||||
while (start < comma && *start != '=') {
|
while (start < comma && *start != '=') {
|
||||||
start++;
|
start++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip over it */
|
if (start < comma) {
|
||||||
start++;
|
/* Skip over '=' */
|
||||||
|
start++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define SKIP_ST(p) while (*p != '\0' && (*p == ' ' || *p == '\t')) p++
|
#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) {
|
if (start < comma) {
|
||||||
object->cache.max_age = atoi(start);
|
object->cache.max_age = atoi(start);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user