Skip to content

Commit a49d5ec

Browse files
authored
Not saving markdown files with "text/markdown" anymore. (#6756)
1 parent 777b39e commit a49d5ec

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

src/NuGetGallery.Core/Services/CoreLicenseFileService.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,7 @@ public Task SaveLicenseFileAsync(Package package, Stream licenseFile)
4242

4343
var fileName = BuildLicenseFileName(package);
4444

45-
// Gallery will generally ignore the content type on license files and will use the value from the DB,
46-
// but we'll be nice and try to specify correct content type for them.
47-
var contentType = package.EmbeddedLicenseType == EmbeddedLicenseFileType.Markdown
48-
? CoreConstants.MarkdownContentType
49-
: CoreConstants.TextContentType;
50-
51-
return _fileStorageService.SaveFileAsync(_metadata.PackageContentFolderName, fileName, contentType, licenseFile, overwrite: true);
45+
return _fileStorageService.SaveFileAsync(_metadata.PackageContentFolderName, fileName, CoreConstants.TextContentType, licenseFile, overwrite: true);
5246
}
5347

5448
public async Task ExtractAndSaveLicenseFileAsync(Package package, Stream packageStream)

tests/NuGetGallery.Core.Facts/Services/CoreLicenseFileServiceFacts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public async Task WillThrowIfPackageIsMissingNormalizedVersionAndVersion(Embedde
9393

9494
[Theory]
9595
[InlineData(EmbeddedLicenseFileType.PlainText, "text/plain")]
96-
[InlineData(EmbeddedLicenseFileType.Markdown, "text/markdown")]
96+
[InlineData(EmbeddedLicenseFileType.Markdown, "text/plain")]
9797
public async Task WillUseNormalizedRegularVersionIfNormalizedVersionMissing(EmbeddedLicenseFileType licenseFileType, string expectedContentType)
9898
{
9999
var fileStorageSvc = new Mock<ICoreFileStorageService>();

0 commit comments

Comments
 (0)