mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-16 16:58:38 +01:00
Summary: Ref T10227. This converts weird hard-codey magic to the new HTTPEngineExtension. Test Plan: See D16090. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10227 Differential Revision: https://secure.phabricator.com/D16091
27 lines
639 B
PHP
27 lines
639 B
PHP
<?php
|
|
|
|
final class ArcanistBlindlyTrustHTTPEngineExtension
|
|
extends PhutilHTTPEngineExtension {
|
|
|
|
const EXTENSIONKEY = 'arc.https.blind';
|
|
|
|
private $domains = array();
|
|
|
|
public function setDomains(array $domains) {
|
|
foreach ($domains as $domain) {
|
|
$this->domains[phutil_utf8_strtolower($domain)] = true;
|
|
}
|
|
return $this;
|
|
}
|
|
|
|
public function getExtensionName() {
|
|
return pht('Arcanist HTTPS Trusted Domains');
|
|
}
|
|
|
|
public function shouldTrustAnySSLAuthorityForURI(PhutilURI $uri) {
|
|
$domain = $uri->getDomain();
|
|
$domain = phutil_utf8_strtolower($domain);
|
|
return isset($this->domains[$domain]);
|
|
}
|
|
|
|
}
|