Skip to content

Commit d658486

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: (39 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 initialize the current time with midnight before modifying the date [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 fix tests [HttpClient] Let curl handle transfer encoding ...
2 parents 00a2d6e + 344a18f commit d658486

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

RedirectResponse.php

+1
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

+7
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)