diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index efebbd2..bee9b61 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1439,7 +1439,7 @@ function install_download_translation(&$install_state) {
 }
 
 /**
- * Attempts to get a file using a http request and to store it locally.
+ * Attempts to get a file using a HTTP request and to store it locally.
  *
  * @param string $uri
  *   The URI of the file to grab.
@@ -1463,11 +1463,8 @@ function install_retrieve_file($uri, $destination) {
   }
 
   try {
-    $data = drupal_container()
-      ->get('http_default_client')
-      ->get($uri, array('Accept' => 'text/plain'))
-      ->send()
-      ->getBody(TRUE);
+    $request = drupal_container()->get('http_default_client')->get($uri, array('Accept' => 'text/plain'));
+    $data = $request->send()->getBody(TRUE);
     if (empty($data)) {
       return FALSE;
     }
@@ -1488,8 +1485,8 @@ function install_retrieve_file($uri, $destination) {
  *   TRUE if the URI was contacted successfully, FALSE if not.
  */
 function install_check_localization_server($uri) {
-  $request = drupal_container()->get('http_default_client')->head($uri);
   try {
+    $request = drupal_container()->get('http_default_client')->head($uri);
     $response = $request->send();
     return TRUE;
   }
