X-Git-Url: https://git.rapsys.eu/packbundle/blobdiff_plain/ee4b6e042d3dc0c804363cdec07530a424cb9665..HEAD:/Controller.php

diff --git a/Controller.php b/Controller.php
index 148d37c..77a3e14 100644
--- a/Controller.php
+++ b/Controller.php
@@ -63,15 +63,7 @@ class Controller extends AbstractController implements ServiceSubscriberInterfac
 		$this->config = $container->getParameter($this->alias = RapsysPackBundle::getAlias());
 
 		//Set ctx
-		$this->ctx = stream_context_create(
-			[
-				'http' => [
-					'max_redirects' => $_ENV['RAPSYSPACK_REDIRECT'] ?? 20,
-					'timeout' => $_ENV['RAPSYSPACK_TIMEOUT'] ?? (($timeout = ini_get('default_socket_timeout')) !== false && $timeout !== '' ? (float)$timeout : 60),
-					'user_agent' => $_ENV['RAPSYSPACK_AGENT'] ?? (($agent = ini_get('user_agent')) !== false && $agent !== '' ? (string)$agent : $this->alias.'/'.($this->version = RapsysPackBundle::getVersion()))
-				]
-			]
-		);
+		$this->ctx = stream_context_create($this->config['context']);
 	}
 
 	/**