public function Asset::getHeaders in Mini site 8
Array of headers for current asset.
Return value
array Array of headers keyed by header name.
File
- src/
Asset.php, line 472
Class
- Asset
- Class Asset.
Namespace
Drupal\minisiteCode
public function getHeaders() {
$headers = [];
if ($this
->isDocument()) {
$headers['Content-Language'] = $this
->getLanguage();
$headers['Content-Type'] = $this
->getMimeType() . '; charset=UTF-8';
}
else {
$type = Unicode::mimeHeaderEncode($this
->getMimeType());
$headers['Content-Type'] = $type;
$headers['Accept-Ranges'] = 'bytes';
$size = $this
->getSize();
if ($size) {
$headers['Content-Length'] = $size;
}
}
return $headers;
}