public function prepare(Request
$request):
static { $headers =
$this->headers;
if ($this->
isInformational() ||
$this->
isEmpty()) { $this->
setContent(null
);
$headers->
remove('Content-Type'
);
$headers->
remove('Content-Length'
);
// prevent PHP from sending the Content-Type header based on default_mimetype
ini_set('default_mimetype', ''
);
} else { // Content-type based on the Request
if (!
$headers->
has('Content-Type'
)) { $format =
$request->
getRequestFormat(null
);
if (null !==
$format &&
$mimeType =
$request->
getMimeType($format)) { $headers->
set('Content-Type',
$mimeType);
}