From c43daebe3f26c664e37c521206d7d949c187c148 Mon Sep 17 00:00:00 2001 From: Roman Colohanin Date: Fri, 13 Mar 2015 18:41:42 +0300 Subject: [PATCH] fix exception when jira returns 201 http status --- src/Jira/Api/Client/CurlClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Jira/Api/Client/CurlClient.php b/src/Jira/Api/Client/CurlClient.php index 4a30d41..ae421a6 100644 --- a/src/Jira/Api/Client/CurlClient.php +++ b/src/Jira/Api/Client/CurlClient.php @@ -102,7 +102,7 @@ public function sendRequest($method, $url, $data = array(), $endpoint, Authentic if (curl_getinfo($curl, CURLINFO_HTTP_CODE) == 401) { throw new UnauthorizedException("Unauthorized"); } - if ($data === '' && curl_getinfo($curl, CURLINFO_HTTP_CODE) != 204) { + if ($data === '' && !in_array(curl_getinfo($curl, CURLINFO_HTTP_CODE), array(201,204))) { throw new Exception("JIRA Rest server returns unexpected result."); } @@ -114,4 +114,4 @@ public function sendRequest($method, $url, $data = array(), $endpoint, Authentic } -} \ No newline at end of file +}