Skip to content

MimeTypes::getExtensions returns an empty array with application/x-ndjson mime type #61135

@AZoumis

Description

@AZoumis

Symfony version(s) affected

7.4

Description

Hi there,

I noticed that MimeTypes::getExtensions returns an empty array with application/x-ndjson mime type. However, I would expect the return array to return atleast json

How to reproduce

You can use this file to reproduce this issue: ndjson_example.json

$mimeType = mime_content_type('ndjson_example.json');
var_dump($mimeType); // string(20) "application/x-ndjson"
var_dump(new MimeTypes()->getExtensions($mimeType)); // array(0) {}

You can also reproduce the issue without a file:

var_dump(new MimeTypes()->getExtensions('application/x-ndjson')); // array(0) {}

Possible Solution

No response

Additional Context

https://cdn.jsdelivr.net/gh/jshttp/mime-db/db.json doesn't seem to contain application/x-ndjson.
Using PHP v8.4.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions