Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/response/DiffusionGitLFSResponse.php
12241 views
1
<?php
2
3
final class DiffusionGitLFSResponse extends AphrontResponse {
4
5
private $content;
6
7
public static function newErrorResponse($code, $message) {
8
9
// We can optionally include "request_id" and "documentation_url" in
10
// this response.
11
12
return id(new self())
13
->setHTTPResponseCode($code)
14
->setContent(
15
array(
16
'message' => $message,
17
));
18
}
19
20
public function setContent(array $content) {
21
$this->content = phutil_json_encode($content);
22
return $this;
23
}
24
25
public function buildResponseString() {
26
return $this->content;
27
}
28
29
public function getHeaders() {
30
$headers = array(
31
array('Content-Type', 'application/vnd.git-lfs+json'),
32
);
33
34
return array_merge(parent::getHeaders(), $headers);
35
}
36
37
}
38
39