@@ -24,6 +24,13 @@ function getContents(
2424
2525 // TODO: consider url validation at this point
2626
27+ $ config = [
28+ 'useragent ' => Configuration::getConfig ('http ' , 'useragent ' ),
29+ 'timeout ' => Configuration::getConfig ('http ' , 'timeout ' ),
30+ 'retries ' => Configuration::getConfig ('http ' , 'retries ' ),
31+ 'curl_options ' => $ curlOptions ,
32+ ];
33+
2734 $ httpHeadersNormalized = [];
2835 foreach ($ httpHeaders as $ httpHeader ) {
2936 $ parts = explode (': ' , $ httpHeader );
@@ -69,13 +76,7 @@ function getContents(
6976 'TE ' => 'trailers ' ,
7077 ];
7178
72- $ config = [
73- 'useragent ' => Configuration::getConfig ('http ' , 'useragent ' ),
74- 'timeout ' => Configuration::getConfig ('http ' , 'timeout ' ),
75- 'retries ' => Configuration::getConfig ('http ' , 'retries ' ),
76- 'headers ' => array_merge ($ defaultHttpHeaders , $ httpHeadersNormalized ),
77- 'curl_options ' => $ curlOptions ,
78- ];
79+ $ config ['headers ' ] = array_merge ($ defaultHttpHeaders , $ httpHeadersNormalized );
7980
8081 $ maxFileSize = Configuration::getConfig ('http ' , 'max_filesize ' );
8182 if ($ maxFileSize ) {
0 commit comments