lithium\action\Response::headers()
Overrides
lithium\net\http\Message::headers()
Expands on \net\http\Message::headers()
with some magic conversions for shorthand headers.
Parameters
-
string|array
$key
-
mixed
$value
-
boolean
$replace
Returns
mixedSource
public function headers($key = null, $value = null, $replace = true) {
if ($key === 'download' || $key === 'Download') {
$message = "Shorthand header `Download` with `<FILENAME>` has been deprecated ";
$message .= "because it's too magic. Please use `Content-Disposition` ";
$message .= "with `attachment; filename=\"<FILENAME>\"` instead.";
trigger_error($message, E_USER_DEPRECATED);
$key = 'Content-Disposition';
$value = 'attachment; filename="' . $value . '"';
}
return parent::headers($key, $value, $replace);
}