Remove shield for Conduit API responses

Summary: 'cuz we don't need it and it's lame complexity for API clients of all kinds. Rip the band-aid off now.

Test Plan: used conduit console and verified no more shield. also did some JS stuff around the suite to verify I didn't kill JS

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T891

Differential Revision: https://secure.phabricator.com/D3265
This commit is contained in:
Bob Trahan
2012-08-13 14:49:32 -07:00
parent 0f919ecd3c
commit dd26bc6d1a
3 changed files with 18 additions and 6 deletions
+17 -2
View File
@@ -22,15 +22,31 @@
final class AphrontJSONResponse extends AphrontResponse {
private $content;
private $addJSONShield;
public function setContent($content) {
$this->content = $content;
return $this;
}
public function setAddJSONShield($should_add) {
$this->addJSONShield = $should_add;
return $this;
}
public function shouldAddJSONShield() {
if ($this->addJSONShield === null) {
return true;
}
return (bool) $this->addJSONShield;
}
public function buildResponseString() {
$response = $this->encodeJSONForHTTPResponse($this->content);
return $this->addJSONShield($response, $use_javelin_shield = false);
if ($this->shouldAddJSONShield()) {
$response = $this->addJSONShield($response, $use_javelin_shield = false);
}
return $response;
}
public function getHeaders() {
@@ -40,5 +56,4 @@ final class AphrontJSONResponse extends AphrontResponse {
$headers = array_merge(parent::getHeaders(), $headers);
return $headers;
}
}