Skip to content

Commit 3688a10

Browse files
committed
upd raw data are sent to curl in abstact http connector
1 parent 9c2052a commit 3688a10

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Connectors/Http/HttpJsonRpcConnectorAbstract.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function orderNodesByTimeoutMs($orderNodesByTimeoutMs)
116116
$answerRaw = $this->curlRequest(
117117
$currentNodeURL,
118118
'post',
119-
json_encode($requestData, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
119+
$requestData,
120120
$curlOptions
121121
);
122122

@@ -231,7 +231,7 @@ public function doRequest($apiName, array $data, $answerFormat = self::ANSWER_FO
231231
$answerRaw = $this->curlRequest(
232232
$this->getCurrentUrl(),
233233
'post',
234-
json_encode($requestData, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
234+
$requestData,
235235
$curlOptions
236236
);
237237
if ($answerRaw['code'] !== 200) {
@@ -280,7 +280,7 @@ public function curlRequest($url, $type = 'get', $data = [], $curlOptions = [])
280280

281281
if ($type == 'post') {
282282
curl_setopt($ch, CURLOPT_POST, true);
283-
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
283+
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
284284
} elseif ($type == 'get' && !empty($data)) {
285285
$temp = parse_url($url);
286286
if (!empty($temp['query'])) {
@@ -321,6 +321,9 @@ public function makeUrlFromArray($data)
321321
if (!empty($data['host'])) {
322322
$url .= $data['host'];
323323
}
324+
if (!empty($data['port'])) {
325+
$url .= ':' . $data['port'];
326+
}
324327
if (!empty($data['path'])) {
325328
$url .= $data['path'];
326329
}

0 commit comments

Comments
 (0)