Skip to content

Commit

Permalink
Merge a13fbdc into dab8807
Browse files Browse the repository at this point in the history
  • Loading branch information
Ogün KARAKUŞ committed Apr 23, 2014
2 parents dab8807 + a13fbdc commit c4d8d3e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions library/Requests/Session.php
Expand Up @@ -81,8 +81,9 @@ public function __construct($url = null, $headers = array(), $data = array(), $o
* @return mixed|null Property value, null if none found
*/
public function __get($key) {
if (isset($this->options[$key]))
if (isset($this->options[$key])) {
return $this->options[$key];
}

return null;
}
Expand Down Expand Up @@ -112,7 +113,9 @@ public function __isset($key) {
* @param string $key Property key
*/
public function __unset($key) {
$this->options[$key] = null;
if (isset($this->options[$key])) {
unset($this->options[$key]);
}
}

/**#@+
Expand Down Expand Up @@ -236,6 +239,7 @@ protected function merge_request($request, $merge_options = true) {
$request['url'] = Requests_IRI::absolutize($this->url, $request['url']);
$request['url'] = $request['url']->uri;
}

$request['headers'] = array_merge($this->headers, $request['headers']);

if (is_array($request['data']) && is_array($this->data)) {
Expand All @@ -248,6 +252,7 @@ protected function merge_request($request, $merge_options = true) {
// Disallow forcing the type, as that's a per request setting
unset($request['options']['type']);
}

return $request;
}
}
}

0 comments on commit c4d8d3e

Please sign in to comment.