From 207c2c233eaa38b4f710eb6ac50c135970614106 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Sun, 1 Mar 2015 16:04:18 -0600 Subject: [PATCH] Fixed CURLINFO_HEADER_SIZE miscalculations if Proxy Enabled - Fixes #258 --- lib/PayPal/Core/PayPalHttpConnection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PayPal/Core/PayPalHttpConnection.php b/lib/PayPal/Core/PayPalHttpConnection.php index 945ad9d..57bf623 100644 --- a/lib/PayPal/Core/PayPalHttpConnection.php +++ b/lib/PayPal/Core/PayPalHttpConnection.php @@ -148,7 +148,8 @@ class PayPalHttpConnection // Get Request and Response Headers $requestHeaders = curl_getinfo($ch, CURLINFO_HEADER_OUT); - $responseHeaderSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + //Using alternative solution to CURLINFO_HEADER_SIZE as it throws invalid number when called using PROXY. + $responseHeaderSize = strlen($result) - curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD); $responseHeaders = substr($result, 0, $responseHeaderSize); $result = substr($result, $responseHeaderSize);