Skip to content

Commit 9bb9a12

Browse files
La0Bastien Abadie
and
Bastien Abadie
authoredFeb 4, 2025
Bug 1944522 - Add HTTP Body option in Harbormaster HTTP Build step
Co-authored-by: Bastien Abadie <bastien@nextcairn.com>
1 parent bb12752 commit 9bb9a12

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,21 @@ public function execute(
5959

6060
$method = nonempty(idx($settings, 'method'), 'POST');
6161

62-
$content_type = $settings['content_type'];
63-
6462
$future = id(new HTTPSFuture($uri))
6563
->setMethod($method)
6664
->setTimeout(60);
6765

66+
$content_type = $settings['content_type'];
6867
if ($content_type) {
6968
$future->addHeader('Content-Type', $content_type);
7069
}
7170

71+
$body = $settings['http_body'];
72+
if ($body) {
73+
$body = $this->mergeVariables('vurisprintf', $body, $variables);
74+
$future->setData($body);
75+
}
76+
7277
$credential_phid = $this->getSetting('credential');
7378
if ($credential_phid) {
7479
$key = PassphrasePasswordKey::loadFromPHID(
@@ -117,6 +122,11 @@ public function getFieldSpecifications() {
117122
'type' => 'text',
118123
'required' => false,
119124
),
125+
'http_body' => array(
126+
'name' => pht('HTTP Body'),
127+
'type' => 'text',
128+
'required' => false,
129+
),
120130
);
121131
}
122132

0 commit comments

Comments
 (0)
Failed to load comments.