Skip to content
This repository
Browse code

Only parse HTTP response headers if present.

  • Loading branch information...
commit 99729c0bbbb784f0b45fcec473b5609c58325d31 1 parent 8070975
Anton Lindqvist authored

Showing 1 changed file with 9 additions and 6 deletions. Show diff stats Hide diff stats

  1. +9 6 Services/Soundcloud.php
15 Services/Soundcloud.php
@@ -921,13 +921,16 @@ protected function _request($url, $curlOptions = array())
921 921
922 922 curl_close($ch);
923 923
924   - $this->_lastHttpResponseHeaders = $this->_parseHttpHeaders(
925   - substr($data, 0, $info['header_size'])
926   - );
927   - if(array_key_exists(CURLOPT_HEADER, $options) && !$options[CURLOPT_HEADER])
928   - $this->_lastHttpResponseBody = $data;
929   - else
  924 + if (array_key_exists(CURLOPT_HEADER, $options) && $options[CURLOPT_HEADER]) {
  925 + $this->_lastHttpResponseHeaders = $this->_parseHttpHeaders(
  926 + substr($data, 0, $info['header_size'])
  927 + );
930 928 $this->_lastHttpResponseBody = substr($data, $info['header_size']);
  929 + } else {
  930 + $this->_lastHttpResponseHeaders = array();
  931 + $this->_lastHttpResponseBody = $data;
  932 + }
  933 +
931 934 $this->_lastHttpResponseCode = $info['http_code'];
932 935
933 936 if ($this->_validResponseCode($this->_lastHttpResponseCode)) {

0 comments on commit 99729c0

Please sign in to comment.
Something went wrong with that request. Please try again.