Skip to content

Commit 2932365

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: explicitly mark nullable parameters as nullable fix low deps tests [HttpKernel] Fix datacollector caster for reference object property bug #51578 [Cache] always select database for persistent redis connections [Security] Validate that CSRF token in form login is string similar to username/password [validator] validated Dutch translation Improve dutch translations [Translation] Skip state=needs-translation entries only when source == target [HttpKernel] Ensure controllers are not lazy [Validator] Fill in trans-unit id 113: This URL does not contain a TLD. [Validator] added missing Polish translation for unit 113 [Validator] add missing lv translation [HttpClient] Let curl handle transfer encoding [Messenger] Make Doctrine connection ignore unrelated tables on setup [HttpFoundation] Set content-type header in RedirectResponse add translations for the requireTld constraint option message [Serializer] Fix unexpected allowed attributes [FrameworkBundle] Fix registration of the bundle path to translation
2 parents ebc713b + 3c8deb7 commit 2932365

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

RedirectResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function setTargetUrl(string $url): static
8585
</html>', htmlspecialchars($url, \ENT_QUOTES, 'UTF-8')));
8686

8787
$this->headers->set('Location', $url);
88+
$this->headers->set('Content-Type', 'text/html; charset=utf-8');
8889

8990
return $this;
9091
}

Tests/RedirectResponseTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ public function testGenerateLocationHeader()
4444
$this->assertEquals('foo.bar', $response->headers->get('Location'));
4545
}
4646

47+
public function testGenerateContentTypeHeader()
48+
{
49+
$response = new RedirectResponse('foo.bar');
50+
51+
$this->assertSame('text/html; charset=utf-8', $response->headers->get('Content-Type'));
52+
}
53+
4754
public function testGetTargetUrl()
4855
{
4956
$response = new RedirectResponse('foo.bar');

0 commit comments

Comments
 (0)