diff --git a/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
index 2ae1853..2129d48 100644
--- a/core/lib/Drupal/Core/Ajax/AjaxResponse.php
+++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
@@ -65,6 +65,9 @@ public function &getCommands() {
    */
   public function prepare(Request $request) {
     $this->prepareResponse($request);
+
+    $this->headers->set('Content-Type', 'text/javascript');
+
     return $this;
   }
 
