Permalink
Browse files

Update Services/Soundcloud.php

I ve add some fix in order to handle CURLOPT_HEADER correctly.
Perhaps it will be helpfull. 
In my case curl_getinfo was returning a bad header_size so i has a problem to get use the json correctly.
  • Loading branch information...
1 parent 664a9ef commit 3aaeb49334f5e15e05c23783cf3fbc9d2863fe33 @hmanprod hmanprod committed Jan 16, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 Services/Soundcloud.php
View
@@ -924,7 +924,10 @@ protected function _request($url, $curlOptions = array())
$this->_lastHttpResponseHeaders = $this->_parseHttpHeaders(
substr($data, 0, $info['header_size'])
);
- $this->_lastHttpResponseBody = substr($data, $info['header_size']);
+ if(array_key_exists(CURLOPT_HEADER, $options) && !$options[CURLOPT_HEADER])
+ $this->_lastHttpResponseBody = $data;
+ else
+ $this->_lastHttpResponseBody = substr($data, $info['header_size']);
$this->_lastHttpResponseCode = $info['http_code'];
if ($this->_validResponseCode($this->_lastHttpResponseCode)) {

0 comments on commit 3aaeb49

Please sign in to comment.