1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 01:10:58 +01:00

Automatically select the right Conduit URI path for the irc bot

Summary: The docs say "http://www.domain.com/" but if you don't put "/api/" it fails. GOTCHA!

Test Plan: Removed "/api/", launched bot, it worked.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T935

Differential Revision: https://secure.phabricator.com/D1763
This commit is contained in:
epriestley 2012-03-05 09:57:21 -08:00
parent 5590515007
commit 37451ffb25
2 changed files with 7 additions and 0 deletions

View file

@ -76,6 +76,12 @@ final class PhabricatorIRCBot extends PhabricatorDaemon {
$conduit_user = idx($config, 'conduit.user');
$conduit_cert = idx($config, 'conduit.cert');
// Normalize the path component of the URI so users can enter the
// domain without the "/api/" part.
$conduit_uri = new PhutilURI($conduit_uri);
$conduit_uri->setPath('/api/');
$conduit_uri = (string)$conduit_uri;
$conduit = new ConduitClient($conduit_uri);
$response = $conduit->callMethodSynchronous(
'conduit.connect',

View file

@ -12,6 +12,7 @@ phutil_require_module('phabricator', 'infrastructure/daemon/irc/message');
phutil_require_module('phutil', 'conduit/client');
phutil_require_module('phutil', 'error');
phutil_require_module('phutil', 'filesystem');
phutil_require_module('phutil', 'parser/uri');
phutil_require_module('phutil', 'utils');