diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 522159f0..5a970e1e 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1167,6 +1167,8 @@ function system_time_zones($blank = NULL, $grouped = FALSE) { * - FileSystemInterface::EXISTS_RENAME: Append _{incrementing number} until * the filename is unique. * - FileSystemInterface::EXISTS_ERROR: Do nothing and return FALSE. + * @param array $options + * Optional array of options to pass to \Drupal::httpClient()->get(). * * @return mixed * One of these possibilities: @@ -1176,7 +1178,7 @@ function system_time_zones($blank = NULL, $grouped = FALSE) { * object which describes the file. * - If it fails, FALSE. */ -function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FileSystemInterface::EXISTS_RENAME) { +function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FileSystemInterface::EXISTS_RENAME, array $options = []) { $parsed_url = parse_url($url); /** @var \Drupal\Core\File\FileSystemInterface $file_system */ $file_system = \Drupal::service('file_system'); @@ -1196,7 +1198,7 @@ function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $repl } try { $data = (string) \Drupal::httpClient() - ->get($url) + ->get($url, $options) ->getBody(); if ($managed) { /** @var \Drupal\file\FileRepositoryInterface $file_repository */