Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14476974
D8520.id20216.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8520.id20216.diff
View Options
diff --git a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php
--- a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php
+++ b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php
@@ -16,7 +16,7 @@
$uri = new PhutilURI($settings['uri']);
$domain = $uri->getDomain();
- return pht('Make an HTTP request to %s', $domain);
+ return pht('Make an HTTP %s request to %s', $settings['method'], $domain);
}
public function execute(
@@ -34,8 +34,13 @@
$log_body = $build->createLog($build_target, $uri, 'http-body');
$start = $log_body->start();
+ $method = 'POST';
+ if ($settings['method'] !== '') {
+ $method = $settings['method'];
+ }
+
list($status, $body, $headers) = id(new HTTPSFuture($uri))
- ->setMethod('POST')
+ ->setMethod($method)
->setTimeout(60)
->resolve();
@@ -54,6 +59,12 @@
return false;
}
+ if ($settings['method'] === null || $settings['method'] != '' &&
+ !in_array ($settings['method'],
+ array('GET', 'PUT', 'DELETE', 'POST'))) {
+ return false;
+ }
+
return true;
}
@@ -64,6 +75,12 @@
'description' => pht('The URI to request.'),
'type' => BuildStepImplementation::SETTING_TYPE_STRING,
),
+ 'method' => array(
+ 'name' => 'Method',
+ 'description' =>
+ pht('Request type. Should be GET, POST, PUT, or DELETE.'),
+ 'type' => BuildStepImplementation::SETTING_TYPE_STRING,
+ ),
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 29, 10:13 AM (8 h, 28 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6942032
Default Alt Text
D8520.id20216.diff (1 KB)
Attached To
Mode
D8520: Added 'method' field to the HTTP request build step.
Attached
Detach File
Event Timeline
Log In to Comment