From 77c758975328e37bf4f27461a14c6545ec582961 Mon Sep 17 00:00:00 2001 From: brluk and dkatz Date: Wed, 14 Dec 2016 21:10:32 +0000 Subject: [PATCH] Only add the PayPal-Request-Id header if the value is set --- lib/PayPal/Handler/RestHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PayPal/Handler/RestHandler.php b/lib/PayPal/Handler/RestHandler.php index ec5298d..6bc55ae 100644 --- a/lib/PayPal/Handler/RestHandler.php +++ b/lib/PayPal/Handler/RestHandler.php @@ -82,7 +82,7 @@ class RestHandler implements IPayPalHandler $httpConfig->addHeader('Authorization', "Bearer " . $credential->getAccessToken($config), false); } - if ($httpConfig->getMethod() == 'POST' || $httpConfig->getMethod() == 'PUT') { + if (($httpConfig->getMethod() == 'POST' || $httpConfig->getMethod() == 'PUT') && !is_null($this->apiContext->getRequestId())) { $httpConfig->addHeader('PayPal-Request-Id', $this->apiContext->getRequestId()); } // Add any additional Headers that they may have provided