Skip to content

Commit e1628a2

Browse files
committed
Fixed: curl response format
1 parent 8fc8a67 commit e1628a2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

CPanel.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function call($module, $function, $args = array())
167167
CURLOPT_RETURNTRANSFER => true,
168168
CURLOPT_ENCODING => "",
169169
CURLOPT_MAXREDIRS => 10,
170-
CURLOPT_TIMEOUT => 100020,
170+
CURLOPT_TIMEOUT => 30,
171171
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
172172
CURLOPT_CUSTOMREQUEST => "GET",
173173
CURLOPT_POSTFIELDS => "",
@@ -183,15 +183,15 @@ public function call($module, $function, $args = array())
183183

184184
curl_close($curl);
185185

186-
187186
$response['inputs']['url'] = $url;
188-
$response['data']['header_size'] = $header_size;
189-
$response['data']['header'] = $header;
190-
$response['data']['response'] = json_decode($curl_res);
191-
$response['data']['body'] = $body;
192-
$response['data']['error'] = $err;
193-
$response['data']['err_no'] = $err_no;
194-
187+
$response['curl_response'] = [
188+
'header_size' => $header_size,
189+
'header' => $header,
190+
'response' => $curl_res,
191+
'body' => $body,
192+
'error' => $err,
193+
'err_no' => $err_no,
194+
];
195195

196196
if ($err || $err_no) {
197197

@@ -207,6 +207,7 @@ public function call($module, $function, $args = array())
207207
$response['inputs']['url'] = $url;
208208
} else
209209
{
210+
$response['data'] = json_decode($curl_res);
210211
$response['status'] = 'success';
211212
$response['inputs']['url'] = $url;
212213
}

0 commit comments

Comments
 (0)