From 82bc395812a33422e069d2f6b06638065db0c1e4 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Thu, 16 Nov 2017 19:12:43 +0100
Subject: [PATCH] - added http status code to headers from ::post($url, $data,
 true)

---
 interface/lib/classes/ispconfig_request.inc.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/interface/lib/classes/ispconfig_request.inc.php b/interface/lib/classes/ispconfig_request.inc.php
index 479c11b5e0..6d28a51b9b 100644
--- a/interface/lib/classes/ispconfig_request.inc.php
+++ b/interface/lib/classes/ispconfig_request.inc.php
@@ -250,6 +250,9 @@ abstract class ISPConfigRequest {
 			foreach($tmpheaders as $cur) {
 				if(preg_match('/^(\w+)\:\s*(.*)$/is', $cur, $matches)) {
 					$headers["$matches[1]"] = trim($matches[2]);
+				} elseif(strpos($cur, ':') === false && substr($cur, 0, 5) === 'HTTP/') {
+					$headers['status'] = $header;
+					$headers['http_code'] = intval(preg_replace('/^HTTP\/\d+\.\d+\s+(\d+)\s+.*$/', '$1', $header));
 				}
 			}
 			return array($headers, $response);
-- 
GitLab