Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepository.php
Show First 20 Lines • Show All 2,072 Lines • ▼ Show 20 Lines | public function newBuiltinURIs() { | ||||
$has_shortname = false; | $has_shortname = false; | ||||
$identifier_map = array( | $identifier_map = array( | ||||
PhabricatorRepositoryURI::BUILTIN_IDENTIFIER_CALLSIGN => $has_callsign, | PhabricatorRepositoryURI::BUILTIN_IDENTIFIER_CALLSIGN => $has_callsign, | ||||
PhabricatorRepositoryURI::BUILTIN_IDENTIFIER_SHORTNAME => $has_shortname, | PhabricatorRepositoryURI::BUILTIN_IDENTIFIER_SHORTNAME => $has_shortname, | ||||
PhabricatorRepositoryURI::BUILTIN_IDENTIFIER_ID => true, | PhabricatorRepositoryURI::BUILTIN_IDENTIFIER_ID => true, | ||||
); | ); | ||||
// If the view policy of the repository is public, support anonymous HTTP | |||||
// even if authenticated HTTP is not supported. | |||||
if ($this->getViewPolicy() === PhabricatorPolicies::POLICY_PUBLIC) { | |||||
$allow_http = true; | |||||
} else { | |||||
$allow_http = PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth'); | $allow_http = PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth'); | ||||
} | |||||
$base_uri = PhabricatorEnv::getURI('/'); | $base_uri = PhabricatorEnv::getURI('/'); | ||||
$base_uri = new PhutilURI($base_uri); | $base_uri = new PhutilURI($base_uri); | ||||
$has_https = ($base_uri->getProtocol() == 'https'); | $has_https = ($base_uri->getProtocol() == 'https'); | ||||
$has_https = ($has_https && $allow_http); | $has_https = ($has_https && $allow_http); | ||||
$has_http = !PhabricatorEnv::getEnvConfig('security.require-https'); | $has_http = !PhabricatorEnv::getEnvConfig('security.require-https'); | ||||
$has_http = ($has_http && $allow_http); | $has_http = ($has_http && $allow_http); | ||||
▲ Show 20 Lines • Show All 334 Lines • Show Last 20 Lines |