Skip to content

Commit 483baae

Browse files
authored
Fix #330: Fix curlOptions merging
1 parent de484ab commit 483baae

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Yii Framework 2 Elasticsearch extension Change Log
44
2.1.4 under development
55
-----------------------
66
- Enh #329: Added `curlOptions` attribute for advanced configuration of curl session (yuniorsk)
7+
- Bug #330: Fix `curlOptions` merging (yuniorsk)
78

89
2.1.3 August 07, 2022
910
-----------------------

Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ protected function httpRequest($method, $url, $requestBody = null, $raw = false)
459459
CURLOPT_FORBID_REUSE => false,
460460
];
461461

462-
if (!empty($this->curlOptions)) {
463-
$options = array_merge($options, $this->curlOptions);
462+
foreach ($this->curlOptions as $key => $value) {
463+
$options[$key] = $value;
464464
}
465465

466466
if (!empty($this->auth) || isset($this->nodes[$this->activeNode]['auth']) && $this->nodes[$this->activeNode]['auth'] !== false) {

0 commit comments

Comments
 (0)