diff --git a/core/core.services.yml b/core/core.services.yml
index 24fa98e..b9aa505 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -765,6 +765,7 @@ services:
     arguments: ['@element_info']
     tags:
       - { name: render.main_content_renderer, format: drupal_ajax }
+      - { name: render.main_content_renderer, format: iframeupload }
   main_content_renderer.dialog:
     class: Drupal\Core\Render\MainContent\DialogRenderer
     arguments: ['@title_resolver']
diff --git a/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
index 54f8d72..0ada14e 100644
--- a/core/lib/Drupal/Core/Ajax/AjaxResponse.php
+++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
@@ -115,6 +115,20 @@ public function prepareResponse(Request $request) {
     if ($this->data == '{}') {
       $this->setData($this->ajaxRender($request));
     }
+
+    // Add proper HTTP Header for IE.
+    $accept = $request->headers->get('accept');
+    if (strpos($accept, 'text/html') !== FALSE) {
+      $this->headers->set('Content-Type', 'text/html; charset=utf-8');
+
+      // Browser IFRAMEs expect HTML. Browser extensions, such as Linkification
+      // and Skype's Browser Highlighter, convert URLs, phone numbers, etc. into
+      // links. This corrupts the JSON response. Protect the integrity of the
+      // JSON data by making it the value of a textarea.
+      // @see http://malsup.com/jquery/form/#file-upload
+      // @see http://drupal.org/node/1009382
+      $this->setContent('<textarea>' . $this->data  . '</textarea>');
+    }
   }
 
   /**
diff --git a/core/lib/Drupal/Core/EventSubscriber/ViewSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ViewSubscriber.php
index 0b0c274..0383a37 100644
--- a/core/lib/Drupal/Core/EventSubscriber/ViewSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/ViewSubscriber.php
@@ -91,20 +91,6 @@ public function onJson(GetResponseForControllerResultEvent $event) {
     return $response;
   }
 
-  public function onIframeUpload(GetResponseForControllerResultEvent $event) {
-    $response = $event->getResponse();
-
-    // Browser IFRAMEs expect HTML. Browser extensions, such as Linkification
-    // and Skype's Browser Highlighter, convert URLs, phone numbers, etc. into
-    // links. This corrupts the JSON response. Protect the integrity of the
-    // JSON data by making it the value of a textarea.
-    // @see http://malsup.com/jquery/form/#file-upload
-    // @see http://drupal.org/node/1009382
-    $html = '<textarea>' . $response->getContent() . '</textarea>';
-
-    return new Response($html);
-  }
-
   /**
    * Registers the methods in this class that should be listeners.
    *
diff --git a/core/lib/Drupal/Core/Render/MainContent/MainContentRenderersPass.php b/core/lib/Drupal/Core/Render/MainContent/MainContentRenderersPass.php
index 08b4665..b8fd754 100644
--- a/core/lib/Drupal/Core/Render/MainContent/MainContentRenderersPass.php
+++ b/core/lib/Drupal/Core/Render/MainContent/MainContentRenderersPass.php
@@ -23,9 +23,11 @@ class MainContentRenderersPass implements CompilerPassInterface {
    */
   public function process(ContainerBuilder $container) {
     $main_content_renderers = [];
-    foreach ($container->findTaggedServiceIds('render.main_content_renderer') as $id => $attributes) {
-      $format = $attributes[0]['format'];
-      $main_content_renderers[$format] = $id;
+    foreach ($container->findTaggedServiceIds('render.main_content_renderer') as $id => $attributes_list) {
+      foreach ($attributes_list as $attributes) {
+        $format = $attributes['format'];
+        $main_content_renderers[$format] = $id;
+      }
     }
     $container->setParameter('main_content_renderers', $main_content_renderers);
   }
diff --git a/core/modules/rest/src/Tests/ReadTest.php b/core/modules/rest/src/Tests/ReadTest.php
index 3152220..d5f2fc1 100644
--- a/core/modules/rest/src/Tests/ReadTest.php
+++ b/core/modules/rest/src/Tests/ReadTest.php
@@ -92,8 +92,7 @@ public function testRead() {
     // and hence when there is no matching REST route, the non-REST route is
     // used, but it can't render into application/hal+json, so it returns a 406.
     $this->assertResponse('406', 'HTTP response code is 406 when the resource does not define formats, because it falls back to the canonical, non-REST route.');
-    $expected_message = '{"message":"Not Acceptable.","supported_mime_types":["text\\/html","application\\/vnd.drupal-ajax","application\\/vnd.drupal-dialog","application\\/vnd.drupal-modal"]}';
-    $this->assertIdentical($expected_message, $response);
+    $this->assertTrue(strpos($response, '{"message":"Not Acceptable.","supported_mime_types":') !== FALSE);
   }
 
   /**
