title: How does ASP.NET Core determine MIME types and apply different middleware?
body: <p>I use ASP.NET Core MVC and .NET Core 2.0.</p>
  
  <p>I have some static files, they have different file types, JPEG, PNG, BMP ...</p>
  
  <p>I would like to apply different middleware according to different file types.</p>
  
  <p>Such as PNG file I will use ImageCompressMiddleware, BMP file I will use ImageConvertMiddleware.</p>
  
  <p>How does ASP.NET Core determine MIME types and apply different middleware?</p>
  
  <p>Or according to the file extension.</p>