69 101 =>
'Switching Protocols',
76 203 =>
'Non-Authoritative Information',
78 205 =>
'Reset Content',
79 206 =>
'Partial Content',
80 207 =>
'Multi-status',
81 208 =>
'Already Reported',
84 300 =>
'Multiple Choices',
85 301 =>
'Moved Permanently',
88 304 =>
'Not Modified',
90 306 =>
'Switch Proxy',
91 307 =>
'Temporary Redirect',
92 308 =>
'Permanent Redirect',
95 401 =>
'Unauthorized',
96 402 =>
'Payment Required',
99 405 =>
'Method Not Allowed',
100 406 =>
'Not Acceptable',
101 407 =>
'Proxy Authentication Required',
102 408 =>
'Request Timeout',
105 411 =>
'Length Required',
106 412 =>
'Precondition Failed',
107 413 =>
'Request Entity Too Large',
108 414 =>
'URI Too Long',
109 415 =>
'Unsupported Media Type',
110 416 =>
'Requested range not satisfiable',
111 417 =>
'Expectation Failed',
112 418 =>
'I\'m a teapot',
113 422 =>
'Unprocessable Entity',
115 424 =>
'Failed Dependency',
116 425 =>
'Unordered Collection',
117 426 =>
'Upgrade Required',
118 428 =>
'Precondition Required',
119 429 =>
'Too Many Requests',
120 431 =>
'Request Header Fields Too Large',
121 451 =>
'Unavailable For Legal Reasons',
123 500 =>
'Internal Server Error',
124 501 =>
'Not Implemented',
125 502 =>
'Bad Gateway',
126 503 =>
'Service Unavailable',
127 504 =>
'Gateway Time-out',
128 505 =>
'HTTP Version not supported',
129 506 =>
'Variant Also Negotiates',
130 507 =>
'Insufficient Storage',
131 508 =>
'Loop Detected',
132 509 =>
'Bandwidth Limit Exceeded',
133 511 =>
'Network Authentication Required',
157 public function setStatus($code, $message =
null)
159 if (!is_int($code)) {
160 throw new \InvalidArgumentException(
'The HTTP status code must be of type integer, ' . gettype($code) .
' given.', 1220526013);
162 if ($message ===
null && !isset($this->statusMessages[$code])) {
163 throw new \InvalidArgumentException(
'No message found for HTTP status code "' . $code .
'".', 1220526014);
165 $this->statusCode = $code;
166 $this->statusMessage = $message ?? $this->statusMessages[$code];
187 return $this->statusCode ?: 200;
198 public function setHeader($name, $value, $replaceExistingHeader =
true)
200 if (stripos($name,
'HTTP') === 0) {
201 throw new \InvalidArgumentException(
'The HTTP status header must be set via setStatus().', 1220541963);
203 if ($replaceExistingHeader ===
true || !isset($this->headers[$name])) {
204 $this->headers[$name] = [$value];
206 $this->headers[$name][] = $value;
217 $preparedHeaders = [];
218 if ($this->statusCode !==
null) {
219 $protocolVersion = $_SERVER[
'SERVER_PROTOCOL'] ??
'HTTP/1.0';
221 $preparedHeaders[] = $statusHeader;
223 foreach ($this->headers as $name => $values) {
224 foreach ($values as $value) {
225 $preparedHeaders[] = $name .
': ' . $value;
228 return $preparedHeaders;
249 if (headers_sent() ===
true) {
260 public function send()
263 if ($this->content !==
null) {
280 throw new \InvalidArgumentException(
'The additiona header data must be of type String, ' . gettype(
$additionalHeaderData) .
' given.', 1237370877);
282 if ($this->request->isCached()) {
284 $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
331 return parent::shutdown();