Skip to content

Commit

Permalink
Renamed proxy method and calling togheter from host config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Dec 6, 2010
1 parent 30a70b7 commit d656bda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cake/libs/http_socket.php
Expand Up @@ -245,6 +245,7 @@ public function &request($request = array()) {
if (isset($host)) {
$this->config['host'] = $host;
}
$this->_setProxy();
$cookies = null;

if (is_array($this->request['header'])) {
Expand Down Expand Up @@ -275,7 +276,6 @@ public function &request($request = array()) {
$this->setAuthConfig('Basic', $this->request['uri']['user'], $this->request['uri']['pass']);
}
$this->_setAuth();
$this->_setProxyConfig();

if (is_array($this->request['body'])) {
$this->request['body'] = $this->_httpSerialize($this->request['body']);
Expand Down Expand Up @@ -501,7 +501,7 @@ protected function _setAuth() {
* @return void
* @throws Exception
*/
protected function _setProxyConfig() {
protected function _setProxy() {
if (empty($this->_proxy) || !isset($this->_proxy['host'], $this->_proxy['port'])) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/http_socket.test.php
Expand Up @@ -662,7 +662,7 @@ public function testProxy() {
$this->assertEqual($this->Socket->config['port'], 123);

$this->Socket->setAuthConfig('Test', 'login', 'passwd');
$expected = "GET http://www.cakephp.org/ HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\nAuthorization: Test login.passwd\r\nProxy-Authorization: Test mark.secret\r\n\r\n";
$expected = "GET http://www.cakephp.org/ HTTP/1.1\r\nHost: www.cakephp.org\r\nConnection: close\r\nUser-Agent: CakePHP\r\nProxy-Authorization: Test mark.secret\r\nAuthorization: Test login.passwd\r\n\r\n";
$this->Socket->request('http://www.cakephp.org/');
$this->assertEqual($this->Socket->request['raw'], $expected);
}
Expand Down

0 comments on commit d656bda

Please sign in to comment.