Skip to content

Conversation

rd-botan-kansiray
Copy link

Add MIME Type for .msg

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Add msg extension to list of files used by static file middleware.

Description

Adds support for the .msg file extension (used for Outlook email files) to the FileExtensionContentTypeProvider in the Microsoft.AspNetCore.StaticFiles package. The MIME type application/vnd.ms-outlook is now returned when .msg files are encountered.

This improves developer experience by eliminating the need to manually add this mapping in every project that handles .msg files.

Fixes #63019

@Copilot Copilot AI review requested due to automatic review settings July 31, 2025 10:04
@rd-botan-kansiray rd-botan-kansiray requested review from a team and BrennanConroy as code owners July 31, 2025 10:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds MIME type support for .msg files (Outlook email files) to ASP.NET Core's static file middleware by mapping the .msg extension to the "application/vnd.ms-outlook" MIME type.

  • Adds .msg extension mapping to FileExtensionContentTypeProvider in StaticFiles middleware
  • Adds .msg extension mapping to FileExtensionContentTypeProvider in WebView component
  • Improves developer experience by eliminating manual MIME type configuration for .msg files

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Middleware/StaticFiles/src/FileExtensionContentTypeProvider.cs Adds .msg extension mapping to static files MIME type provider
src/Components/WebView/WebView/src/FileExtensionContentTypeProvider.cs Adds .msg extension mapping to WebView MIME type provider
Comments suppressed due to low confidence (2)

src/Middleware/StaticFiles/src/FileExtensionContentTypeProvider.cs:196

  • The new .msg MIME type mapping lacks test coverage. Consider adding a unit test to verify that the .msg extension correctly maps to 'application/vnd.ms-outlook'.
                { ".msg", "application/vnd.ms-outlook" },

src/Components/WebView/WebView/src/FileExtensionContentTypeProvider.cs:202

  • The new .msg MIME type mapping lacks test coverage. Consider adding a unit test to verify that the .msg extension correctly maps to 'application/vnd.ms-outlook'.
                { ".msg", "application/vnd.ms-outlook" },

@github-actions github-actions bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Jul 31, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 31, 2025
@rd-botan-kansiray
Copy link
Author

@rd-botan-kansiray please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree

@BrennanConroy
Copy link
Member

Thanks for the contribution, but this is not something we will be pursuing. See the issue.

@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-rc1 milestone Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates that the PR has been added by a community member needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileExtensionContentTypeProvider returns no content type for .msg files

2 participants