Skip to content

Commit

Permalink
Improving the way https is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Mar 26, 2014
1 parent ff6c4e1 commit 42dfae7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Tmdb/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,10 @@ public function setSecure($secure)
{
$this->secure = $secure;

if ($this->httpClient instanceof HttpClientInterface) {
$this->getHttpClient()->setBaseUrl($this->getBaseUrl());
}

return $this;
}

Expand Down
10 changes: 10 additions & 0 deletions lib/Tmdb/HttpClient/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,14 @@ public function getLastResponse()
{
return $this->lastResponse;
}

public function getBaseUrl()
{
return $this->getClient()->getBaseUrl();
}

public function setBaseUrl($url)
{
return $this->getClient()->setBaseUrl($url);
}
}
3 changes: 3 additions & 0 deletions lib/Tmdb/HttpClient/HttpClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@ public function delete($path, $body = null, array $parameters = array(), array $
* @return Response
*/
public function request(RequestInterface $request);

public function getBaseUrl();
public function setBaseUrl($url);
}

0 comments on commit 42dfae7

Please sign in to comment.