public static function getMimeByExtension(string $extension): string
    {
        $extension = strtolower($extension);

        if (!isset(static::$types[$extension])) {
            throw new HttpException("Unknown file extension={$extension}");
        }

        return static::$types[$extension];
    }