Asvae\ApiTester\Http\Controllers\AssetsController::getFileContentType PHP Method

getFileContentType() protected method

Figure out appropriate "Content-Type" header by filename.
protected getFileContentType ( $file ) : mixed
$file
return mixed
    protected function getFileContentType($file)
    {
        $array = explode('.', $file);
        $ext = end($array);
        $contentTypes = ['css' => 'text/css', 'js' => 'text/javascript', 'svg' => 'image/svg+xml', 'map' => 'text/css', 'woff' => 'application/x-font-woff', 'woff2' => 'application/x-font-woff2'];
        return $contentTypes[$ext];
    }