diff --git a/src/Controller/FeaturesController.php b/src/Controller/FeaturesController.php
index ff8fd5c..bbe107a 100644
--- a/src/Controller/FeaturesController.php
+++ b/src/Controller/FeaturesController.php
@@ -11,6 +11,7 @@ use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\system\FileDownloadController;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
 
 /**
  * Returns responses for config module routes.
@@ -25,29 +26,40 @@ class FeaturesController implements ContainerInjectionInterface {
   protected $fileDownloadController;
 
   /**
+   * The request stack.
+   *
+   * @var \Symfony\Component\HttpFoundation\RequestStack
+   */
+  protected $requestStack;
+
+  /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      new FileDownloadController()
+      new FileDownloadController(),
+      $container->get('request_stack')
     );
   }
 
   /**
-   * Constructs a ConfigController object.
+   * Constructs a FeaturesController object.
    *
    * @param \Drupal\system\FileDownloadController $file_download_controller
    *   The file download controller.
+   * @param \Symfony\Component\HttpFoundation\RequestStack
+   *   The request stack.
    */
-  public function __construct(FileDownloadController $file_download_controller) {
+  public function __construct(FileDownloadController $file_download_controller, RequestStack $request_stack) {
     $this->fileDownloadController = $file_download_controller;
+    $this->requestStack = $request_stack;
   }
 
   /**
    * Downloads a tarball of the site configuration.
    */
   public function downloadExport() {
-    $session = \Drupal::request()->getSession();
+    $session = $this->requestStack->getCurrentRequest()->getSession();
     if (isset($session)) {
       $archive_name = $session->get('features_download');
       $request = new Request(array('file' => $archive_name));
