Differential D14286 Diff 37385 src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if ($credential_phid) { | ||||
$key->getPasswordEnvelope()); | $key->getPasswordEnvelope()); | ||||
} | } | ||||
$this->resolveFutures( | $this->resolveFutures( | ||||
$build, | $build, | ||||
$build_target, | $build_target, | ||||
array($future)); | array($future)); | ||||
list($status, $body, $headers) = $future->resolve(); | $this->logHTTPResponse($build, $build_target, $future, $uri); | ||||
$header_lines = array(); | |||||
// TODO: We don't currently preserve the entire "HTTP" response header, but | |||||
// should. Once we do, reproduce it here faithfully. | |||||
$status_code = $status->getStatusCode(); | |||||
$header_lines[] = "HTTP {$status_code}"; | |||||
foreach ($headers as $header) { | |||||
list($head, $tail) = $header; | |||||
$header_lines[] = "{$head}: {$tail}"; | |||||
} | |||||
$header_lines = implode("\n", $header_lines); | |||||
$build_target | |||||
->newLog($uri, 'http.head') | |||||
->append($header_lines); | |||||
$build_target | |||||
->newLog($uri, 'http.body') | |||||
->append($body); | |||||
list($status) = $future->resolve(); | |||||
if ($status->isError()) { | if ($status->isError()) { | ||||
throw new HarbormasterBuildFailureException(); | throw new HarbormasterBuildFailureException(); | ||||
} | } | ||||
} | } | ||||
public function getFieldSpecifications() { | public function getFieldSpecifications() { | ||||
return array( | return array( | ||||
'uri' => array( | 'uri' => array( | ||||
Show All 25 Lines |