Issue #3089143 by mr.baileys: FinishResponseSubscriber adds empty Vary-headers on non-cacheable responses
(cherry picked from commit ef2132c02f
)
merge-requests/64/head
parent
4cdb2f4549
commit
6c3ff47479
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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.');
|
||||
|
|
Loading…
Reference in New Issue