diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 5a86c6b01a..46af533643 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -52,6 +52,7 @@ phutil_register_library_map(array( 'AphrontFormToggleButtonsControl' => 'view/form/control/AphrontFormToggleButtonsControl.php', 'AphrontFormTokenizerControl' => 'view/form/control/AphrontFormTokenizerControl.php', 'AphrontFormView' => 'view/form/AphrontFormView.php', + 'AphrontHTMLResponse' => 'aphront/response/AphrontHTMLResponse.php', 'AphrontHTTPSink' => 'aphront/sink/AphrontHTTPSink.php', 'AphrontHTTPSinkTestCase' => 'aphront/sink/__tests__/AphrontHTTPSinkTestCase.php', 'AphrontHeadsupActionListView' => 'view/layout/headsup/AphrontHeadsupActionListView.php', @@ -1317,8 +1318,8 @@ phutil_register_library_map(array( array( 'Aphront304Response' => 'AphrontResponse', 'Aphront400Response' => 'AphrontResponse', - 'Aphront403Response' => 'AphrontWebpageResponse', - 'Aphront404Response' => 'AphrontWebpageResponse', + 'Aphront403Response' => 'AphrontHTMLResponse', + 'Aphront404Response' => 'AphrontHTMLResponse', 'AphrontAjaxResponse' => 'AphrontResponse', 'AphrontAttachedFileView' => 'AphrontView', 'AphrontCSRFException' => 'AphrontException', @@ -1355,6 +1356,7 @@ phutil_register_library_map(array( 'AphrontFormToggleButtonsControl' => 'AphrontFormControl', 'AphrontFormTokenizerControl' => 'AphrontFormControl', 'AphrontFormView' => 'AphrontView', + 'AphrontHTMLResponse' => 'AphrontResponse', 'AphrontHTTPSinkTestCase' => 'PhabricatorTestCase', 'AphrontHeadsupActionListView' => 'AphrontView', 'AphrontHeadsupActionView' => 'AphrontView', @@ -1386,7 +1388,7 @@ phutil_register_library_map(array( 'AphrontTokenizerTemplateView' => 'AphrontView', 'AphrontTypeaheadTemplateView' => 'AphrontView', 'AphrontUsageException' => 'AphrontException', - 'AphrontWebpageResponse' => 'AphrontResponse', + 'AphrontWebpageResponse' => 'AphrontHTMLResponse', 'CelerityPhabricatorResourceController' => 'CelerityResourceController', 'CelerityResourceController' => 'PhabricatorController', 'CelerityResourceGraph' => 'AbstractDirectedGraph', diff --git a/src/aphront/response/Aphront403Response.php b/src/aphront/response/Aphront403Response.php index f2eafd719d..350c0e3a38 100644 --- a/src/aphront/response/Aphront403Response.php +++ b/src/aphront/response/Aphront403Response.php @@ -3,7 +3,7 @@ /** * @group aphront */ -final class Aphront403Response extends AphrontWebpageResponse { +final class Aphront403Response extends AphrontHTMLResponse { private $forbiddenText; public function setForbiddenText($text) { diff --git a/src/aphront/response/Aphront404Response.php b/src/aphront/response/Aphront404Response.php index 69b3603b3f..2821012fc4 100644 --- a/src/aphront/response/Aphront404Response.php +++ b/src/aphront/response/Aphront404Response.php @@ -3,7 +3,7 @@ /** * @group aphront */ -final class Aphront404Response extends AphrontWebpageResponse { +final class Aphront404Response extends AphrontHTMLResponse { public function getHTTPResponseCode() { return 404; diff --git a/src/aphront/response/AphrontHTMLResponse.php b/src/aphront/response/AphrontHTMLResponse.php new file mode 100644 index 0000000000..4448fcdf12 --- /dev/null +++ b/src/aphront/response/AphrontHTMLResponse.php @@ -0,0 +1,16 @@ +content; } - public function getHeaders() { - $headers = array( - array('Content-Type', 'text/html; charset=UTF-8'), - ); - $headers = array_merge(parent::getHeaders(), $headers); - return $headers; - } - }