/** * Copy authentication if on same host * * @param peer.URL $base * @param peer.URL $url * @return peer.URL The given URL */ private function authenticate($base, $url) { if ($base && $url->getHost() === $base->getHost()) { $url->setUser($base->getUser()); $url->setPassword($base->getPassword()); } return $url; }