Skip to content

Commit 344a18f

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: (23 commits) fix merge add missing return type-hints fix merge explicitly mark nullable parameters as nullable fix low deps tests [HttpKernel] Fix datacollector caster for reference object property [Serializer] Fixing PHP warning in the ObjectNormalizer with MaxDepth enabled bug #51578 [Cache] always select database for persistent redis connections [Security] Validate that CSRF token in form login is string similar to username/password [Serializer] Use explicit nullable type [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 ...
2 parents 8789625 + 2932365 commit 344a18f

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)