MINOR: cache: Consider invalid Age values as stale
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 3 Dec 2020 17:19:32 +0000 (18:19 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 4 Dec 2020 09:21:56 +0000 (10:21 +0100)
Do not store responses that have an invalid age header (non numerical,
negative ...).

src/cache.c

index e0560e5..df6bd33 100644 (file)
@@ -897,6 +897,8 @@ enum act_return http_action_store_cache(struct act_rule *rule, struct proxy *px,
                        if (unlikely(object->age > true_maxage))
                                goto out;
                }
+               else
+                       goto out;
                http_remove_header(htx, &ctx);
        }