Page MenuHomePhabricator

D16188.id38943.diff
No OneTemporary

D16188.id38943.diff

diff --git a/src/workflow/ArcanistInstallCertificateWorkflow.php b/src/workflow/ArcanistInstallCertificateWorkflow.php
--- a/src/workflow/ArcanistInstallCertificateWorkflow.php
+++ b/src/workflow/ArcanistInstallCertificateWorkflow.php
@@ -196,14 +196,31 @@
$uri = $conduit_uri;
}
+ $example = 'https://phabricator.example.com/';
+
$uri_object = new PhutilURI($uri);
- if (!$uri_object->getProtocol() || !$uri_object->getDomain()) {
+ $protocol = $uri_object->getProtocol();
+ if (!$protocol || !$uri_object->getDomain()) {
throw new ArcanistUsageException(
pht(
'Server URI "%s" must include a protocol and domain. It should be '.
'in the form "%s".',
$uri,
- 'https://phabricator.example.com/'));
+ $example));
+ }
+
+ $protocol = $uri_object->getProtocol();
+ switch ($protocol) {
+ case 'http':
+ case 'https':
+ break;
+ default:
+ throw new ArcanistUsageException(
+ pht(
+ 'Server URI "%s" must include the "http" or "https" protocol. '.
+ 'It should be in the form "%s".',
+ $uri,
+ $example));
}
$uri_object->setPath('/api/');

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 19, 4:26 PM (2 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224902
Default Alt Text
D16188.id38943.diff (1 KB)

Event Timeline