From 8af870ff694c03d0dce4c2fff5e24fcd0884a3ff Mon Sep 17 00:00:00 2001 From: Ahmad Nassri Date: Thu, 5 Feb 2015 12:53:30 -0500 Subject: [PATCH] fix depreicated method as well! --- src/Unirest/Request.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Unirest/Request.php b/src/Unirest/Request.php index f215562..262cfe1 100644 --- a/src/Unirest/Request.php +++ b/src/Unirest/Request.php @@ -344,14 +344,13 @@ class Request // supporting deprecated http auth method if (!empty($username)) { - curl_setopt($ch, CURLOPT_USERNAME, $username); - curl_setopt($ch, CURLOPT_PASSWORD, $password); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + curl_setopt($ch, CURLOPT_USERPWD, self::$auth['user'] . ':' . self::$auth['pass']); } if (!empty(self::$auth['user'])) { - curl_setopt($ch, CURLOPT_USERPWD, self::$auth['user'] . ':' . self::$auth['pass']); curl_setopt($ch, CURLOPT_HTTPAUTH, self::$auth['method']); + curl_setopt($ch, CURLOPT_USERPWD, self::$auth['user'] . ':' . self::$auth['pass']); } if (self::$proxy['address'] !== false) {