Description
Symfony version(s) affected: 4.3.3+ 9a2fcc9
Description
When running the HttpCache kernel with debug option false and no explicit trace_level, the default does not get initialized. The kernel still unconditionally calls addTraces.
How to reproduce
https://github.com/FriendsOfSymfony/FOSHttpCache/blob/master/tests/Unit/SymfonyCache/EventDispatchingHttpCacheTest.php
https://travis-ci.org/FriendsOfSymfony/FOSHttpCache/jobs/565046971
Possible Solution
Change this
symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php
Lines 101 to 102 in 85016e8
if (!isset($options['trace_level'])) {
$this->options['trace_level'] = $this->options['debug'] ? 'full' : 'none';
}
That code would actually match with the documentation on the parameter: "(default: 'full' if in debug; 'none' otherwise)"
Happy to write a pull request if you agree that this would be correct.