Issue #3089143 by mr.baileys: FinishResponseSubscriber adds empty Vary-headers on non-cacheable responses

(cherry picked from commit ef2132c02f)
merge-requests/64/head
Alex Pott 2020-02-19 10:01:15 +00:00
parent 4cdb2f4549
commit 6c3ff47479
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
2 changed files with 2 additions and 1 deletions

View File

@ -222,7 +222,7 @@ class FinishResponseSubscriber implements EventSubscriberInterface {
// place. Therefore remove ETag, Last-Modified and Vary in that case.
$response->setEtag(NULL);
$response->setLastModified(NULL);
$response->setVary(NULL);
$response->headers->remove('Vary');
}
/**

View File

@ -46,6 +46,7 @@ class RouterTest extends BrowserTestBase {
$this->assertEquals($headers['Content-language'], ['en']);
$this->assertEquals($headers['X-Content-Type-Options'], ['nosniff']);
$this->assertEquals($headers['X-Frame-Options'], ['SAMEORIGIN']);
$this->assertNull($this->drupalGetHeader('Vary'), 'Vary header is not set.');
$this->drupalGet('router_test/test2');
$this->assertRaw('test2', 'The correct string was returned because the route was successful.');