diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php index ac0b993b2f..6b9c5c6802 100644 --- a/src/applications/diffusion/controller/DiffusionServeController.php +++ b/src/applications/diffusion/controller/DiffusionServeController.php @@ -431,10 +431,12 @@ final class DiffusionServeController extends DiffusionController { $uri = $repository->getAlmanacServiceURI( $viewer, - $is_cluster_request, array( - 'http', - 'https', + 'neverProxy' => $is_cluster_request, + 'protocols' => array( + 'http', + 'https', + ), )); if ($uri) { $future = $this->getRequest()->newClusterProxyFuture($uri); diff --git a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php index baf1749252..2a3841892f 100644 --- a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php @@ -151,9 +151,11 @@ abstract class DiffusionSSHWorkflow extends PhabricatorSSHWorkflow { $is_cluster_request = $this->getIsClusterRequest(); $uri = $repository->getAlmanacServiceURI( $viewer, - $is_cluster_request, array( - 'ssh', + 'neverProxy' => $is_cluster_request, + 'protocols' => array( + 'ssh', + ), )); if ($uri) { diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index 334867cc85..37dd5f1ec5 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -1897,14 +1897,22 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO * services, returning raw URIs. * * @param PhabricatorUser Viewing user. - * @param bool `true` to throw if a remote URI would be returned. - * @param list List of allowable protocols. + * @param map Constraints on selectable services. * @return string|null URI, or `null` for local repositories. */ public function getAlmanacServiceURI( PhabricatorUser $viewer, - $never_proxy, - array $protocols) { + array $options) { + + PhutilTypeSpec::checkMap( + $options, + array( + 'neverProxy' => 'bool', + 'protocols' => 'list', + )); + + $never_proxy = $options['neverProxy']; + $protocols = $options['protocols']; $cache_key = $this->getAlmanacServiceCacheKey(); if (!$cache_key) { @@ -2077,10 +2085,12 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO $uri = $this->getAlmanacServiceURI( $viewer, - $never_proxy, array( - 'http', - 'https', + 'neverProxy' => $never_proxy, + 'protocols' => array( + 'http', + 'https', + ), )); if ($uri === null) { return null;