Skip to content

Commit

Permalink
Fix for http_code checking
Browse files Browse the repository at this point in the history
  • Loading branch information
timoj committed May 20, 2019
1 parent a636e2e commit 9e9b001
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Wuunder/Api/Endpoints/Drafts.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function fire()
$error = null;

if (isset($draftRequest->getResponseHeaders()["http_code"])
&& strpos($draftRequest->getResponseHeaders()["http_code"], "200 OK") !== false
&& strpos($draftRequest->getResponseHeaders()["http_code"], "200") !== false
) {
$header = $draftRequest->getResponseHeaders();
$body = $draftRequest->getBody();
Expand Down
2 changes: 1 addition & 1 deletion src/Wuunder/Api/Endpoints/Parcelshop.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function fire()
$error = null;

if (isset($parcelshopRequest->getResponseHeaders()["http_code"])
&& strpos($parcelshopRequest->getResponseHeaders()["http_code"], "200 OK") !== false
&& strpos($parcelshopRequest->getResponseHeaders()["http_code"], "200") !== false
) {
$body = $parcelshopRequest->getBody();
$header = $parcelshopRequest->getResponseHeaders();
Expand Down
2 changes: 1 addition & 1 deletion src/Wuunder/Api/Endpoints/Parcelshops.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function fire()
$header = null;
$error = null;

if (isset($parcelshopsRequest->getResponseHeaders()["http_code"]) && strpos($parcelshopsRequest->getResponseHeaders()["http_code"], "200 OK") !== false) {
if (isset($parcelshopsRequest->getResponseHeaders()["http_code"]) && strpos($parcelshopsRequest->getResponseHeaders()["http_code"], "200") !== false) {
$body = $parcelshopsRequest->getBody();
$header = $parcelshopsRequest->getResponseHeaders();
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/Wuunder/Api/Endpoints/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function fire()
$header = null;
$error = null;

if (isset($shipmentRequest->getResponseHeaders()["http_code"]) && strpos($shipmentRequest->getResponseHeaders()["http_code"], "201 Created") !== false) {
if (isset($shipmentRequest->getResponseHeaders()["http_code"]) && strpos($shipmentRequest->getResponseHeaders()["http_code"], "201") !== false) {
$body = $shipmentRequest->getBody();
$header = $shipmentRequest->getResponseHeaders();
} else {
Expand Down

0 comments on commit 9e9b001

Please sign in to comment.