Skip to content

Commit 82bc395

Browse files
author
Marius Burkard
committed
- added http status code to headers from ::post($url, $data, true)
1 parent 53ca119 commit 82bc395

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

interface/lib/classes/ispconfig_request.inc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ public static function post($url, $data, $get_headers = false, $user_agent = fal
250250
foreach($tmpheaders as $cur) {
251251
if(preg_match('/^(\w+)\:\s*(.*)$/is', $cur, $matches)) {
252252
$headers["$matches[1]"] = trim($matches[2]);
253+
} elseif(strpos($cur, ':') === false && substr($cur, 0, 5) === 'HTTP/') {
254+
$headers['status'] = $header;
255+
$headers['http_code'] = intval(preg_replace('/^HTTP\/\d+\.\d+\s+(\d+)\s+.*$/', '$1', $header));
253256
}
254257
}
255258
return array($headers, $response);

0 commit comments

Comments
 (0)