@@ -48,9 +48,10 @@ private function normalize($options)
48
48
{
49
49
$ normalized = [
50
50
'headers ' => [
51
- 'X-Algolia-Application-Id ' => $ this ->config ->getAppId (),
52
- 'X-Algolia-API-Key ' => $ this ->config ->getAlgoliaApiKey (),
53
- 'User-Agent ' => $ this ->config ->getAlgoliaAgent () !== null
51
+ 'x-algolia-application-id ' => $ this ->config ->getAppId (),
52
+ 'x-algolia-api-key ' => $ this ->config ->getAlgoliaApiKey (),
53
+ 'User-Agent ' =>
54
+ $ this ->config ->getAlgoliaAgent () !== null
54
55
? $ this ->config ->getAlgoliaAgent ()
55
56
: AlgoliaAgent::get (),
56
57
'Content-Type ' => 'application/json ' ,
@@ -61,18 +62,22 @@ private function normalize($options)
61
62
'writeTimeout ' => $ this ->config ->getWriteTimeout (),
62
63
'connectTimeout ' => $ this ->config ->getConnectTimeout (),
63
64
];
64
-
65
65
foreach ($ options as $ optionName => $ value ) {
66
66
if (is_array ($ value ) && $ optionName === 'headers ' ) {
67
67
$ headersToLowerCase = [];
68
-
69
68
foreach ($ value as $ key => $ v ) {
70
69
$ headersToLowerCase [mb_strtolower ($ key )] = $ v ;
71
70
}
72
71
73
- $ normalized [$ optionName ] = $ headersToLowerCase ;
72
+ $ normalized [$ optionName ] = array_merge (
73
+ $ normalized [$ optionName ],
74
+ $ headersToLowerCase
75
+ );
74
76
} else {
75
- $ normalized [$ optionName ] = $ value ;
77
+ $ normalized [$ optionName ] = array_merge (
78
+ $ normalized [$ optionName ],
79
+ $ value
80
+ );
76
81
}
77
82
}
78
83
0 commit comments