
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
MimeMapping
Advanced tools
Constants for (almost) all MIME types and method to determine MIME type from a file name. Contains just over 1000 mime types. The Dictionary is generated from the jshttp/mime-db db.json file. Works similar to .NET's System.Web.MimeMapping.GetMimeMapping. It aggregates data from the following sources: https://www.iana.org/assignments/media-types/media-types.xhtml https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types https://hg.nginx.org/nginx/raw-file/default/conf/mime.types See: https://github.com/jshttp/mime-db#mime-db https://learn.microsoft.com/dotnet/api/system.web.mimemapping.getmimemapping
Constants for (almost) all MIME types and method to determine MIME type from a file name. Contains just over 1000 mime types.
The Dictionary is generated from the jshttp/mime-db db.json.
Works similar to .NET's System.Web.MimeMapping.GetMimeMapping.
It aggregates data from the following sources:
The library is just a literal C# Dictionary<string, string> with over 1000 entries, and a helper method that can be passed a file path.
string myFile = "myimage.jpg";
string mimeType = MimeMapping.MimeUtility.GetMimeMapping(myFile);
Console.WriteLine(mimeType); // output: image/jpeg
string randomFile = "data.asdf";
string mimeType = MimeMapping.MimeUtility.GetMimeMapping(randomFile);
Console.WriteLine(mimeType); // output: application/octet-stream
string rawExtension = "json";
string mimeType = MimeMapping.MimeUtility.GetMimeMapping(rawExtension);
Console.WriteLine(mimeType); // output: application/json
// List all types..
foreach(var kp in MimeMapping.MimeTypes.TypeMap)
{
Console.WriteLine($"File extension: {kp.Key}, mime string: {kp.Value}");
}
//Just use a constant if you already know the file type (performance)
const string mimeType = MimeMapping.KnownMimeTypes.Xlsx
FAQs
Constants for (almost) all MIME types and method to determine MIME type from a file name. Contains just over 1000 mime types. The Dictionary is generated from the jshttp/mime-db db.json file. Works similar to .NET's System.Web.MimeMapping.GetMimeMapping. It aggregates data from the following sources: https://www.iana.org/assignments/media-types/media-types.xhtml https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types https://hg.nginx.org/nginx/raw-file/default/conf/mime.types See: https://github.com/jshttp/mime-db#mime-db https://learn.microsoft.com/dotnet/api/system.web.mimemapping.getmimemapping
We found that mimemapping demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.