Issue #3230547 by larowlan, karishmaamin, amjad1233: \Drupal\media\Controller\OEmbedIframeController::render doesn't set a content-type header
parent
b6e74cf3fb
commit
0a5beb304b
|
@ -134,7 +134,9 @@ class OEmbedIframeController implements ContainerInjectionInterface {
|
||||||
// Return a response instead of a render array so that the frame content
|
// Return a response instead of a render array so that the frame content
|
||||||
// will not have all the blocks and page elements normally rendered by
|
// will not have all the blocks and page elements normally rendered by
|
||||||
// Drupal.
|
// Drupal.
|
||||||
$response = new HtmlResponse();
|
$response = new HtmlResponse('', HtmlResponse::HTTP_OK, [
|
||||||
|
'Content-Type' => 'text/html; charset=UTF-8',
|
||||||
|
]);
|
||||||
$response->addCacheableDependency(Url::createFromRequest($request));
|
$response->addCacheableDependency(Url::createFromRequest($request));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -105,6 +105,7 @@ class OEmbedIframeControllerTest extends MediaKernelTestBase {
|
||||||
$this->assertStringContainsString('&pasta=rigatoni', $content);
|
$this->assertStringContainsString('&pasta=rigatoni', $content);
|
||||||
$this->assertStringContainsString('test.css', $content);
|
$this->assertStringContainsString('test.css', $content);
|
||||||
$this->assertContains('yo_there', $response->getCacheableMetadata()->getCacheTags());
|
$this->assertContains('yo_there', $response->getCacheableMetadata()->getCacheTags());
|
||||||
|
$this->assertStringContainsString('text/html', $response->headers->get('Content-Type'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue