diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php --- a/src/applications/diffusion/controller/DiffusionServeController.php +++ b/src/applications/diffusion/controller/DiffusionServeController.php @@ -431,10 +431,12 @@ $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 --- a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php +++ b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php @@ -151,9 +151,11 @@ $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 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -1897,14 +1897,22 @@ * 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 @@ $uri = $this->getAlmanacServiceURI( $viewer, - $never_proxy, array( - 'http', - 'https', + 'neverProxy' => $never_proxy, + 'protocols' => array( + 'http', + 'https', + ), )); if ($uri === null) { return null;