@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final 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}