BUG Fix regression introduced in #2356 (method call on non-object)
Merge pull request #2445 from tractorcow/pulls/3.1.0-http-add_cache_headers-fix

BUG Fix regression introduced in #2356 (method call on non-object)
Merge branch '3.1.0' into 3.1