Skip to content

Commit

Permalink
Refactoring ApiTokenPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfzdotnet committed Feb 23, 2014
1 parent d334cc1 commit cf0e604
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/Tmdb/HttpClient/Plugin/ApiTokenPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ public function onBeforeSend(Event $event)
{
$url = $event['request']->getUrl(true);

$origionalQuery = $url->getQuery();
$newQuery = clone $origionalQuery;
$url->getQuery()->set('api_key', $this->token->getApiToken());

$newQuery->set('api_key', $this->token->getApiToken());

$event['request']->setUrl($url->setQuery($newQuery));
$event['request']->setUrl($url);
}
}

0 comments on commit cf0e604

Please sign in to comment.