mirror of
https://github.com/mirror/wget.git
synced 2025-03-27 04:20:31 +08:00
Strictly comply with RFC 6797
* src/hsts.c (hsts_store_entry): strictly comply with RFC 6797. RFC 6797 states in section 8.1 that the UA's cached information should only be updated if: "either or both of the max-age and includeSubDomains header field value tokens are conveying information different than that already maintained by the UA."
This commit is contained in:
parent
33d860e1ef
commit
2f1c6a05c8
@ -426,9 +426,8 @@ hsts_store_entry (hsts_store_t store,
|
|||||||
hsts_remove_entry (store, kh);
|
hsts_remove_entry (store, kh);
|
||||||
else if (max_age > 0)
|
else if (max_age > 0)
|
||||||
{
|
{
|
||||||
entry->include_subdomains = include_subdomains;
|
if (entry->max_age != max_age ||
|
||||||
|
entry->include_subdomains != include_subdomains)
|
||||||
if (entry->max_age != max_age)
|
|
||||||
{
|
{
|
||||||
/* RFC 6797 states that 'max_age' is a TTL relative to the reception of the STS header
|
/* RFC 6797 states that 'max_age' is a TTL relative to the reception of the STS header
|
||||||
so we have to update the 'created' field too */
|
so we have to update the 'created' field too */
|
||||||
@ -436,6 +435,7 @@ hsts_store_entry (hsts_store_t store,
|
|||||||
if (t != -1)
|
if (t != -1)
|
||||||
entry->created = t;
|
entry->created = t;
|
||||||
entry->max_age = max_age;
|
entry->max_age = max_age;
|
||||||
|
entry->include_subdomains = include_subdomains;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* we ignore negative max_ages */
|
/* we ignore negative max_ages */
|
||||||
|
Loading…
Reference in New Issue
Block a user