Share via


정적 파일: CSV 콘텐츠 형식이 표준 규격으로 변경됨

ASP.NET Core 5.0에서는 정적 파일 미들웨어.csv 파일에 사용하는 Content-Type 응답 헤더 값이 표준 규격 값 text/csv로 변경되었습니다.

이 문제에 대한 자세한 내용은 dotnet/aspnetcore#17385를 참조하세요.

도입된 버전

5.0 미리 보기 1

이전 동작

Content-Type 헤더 값 application/octet-stream이 사용되었습니다.

새 동작

Content-Type 헤더 값 text/csv가 사용됩니다.

변경 이유

RFC 7111 표준을 준수합니다.

앱이 이 변경의 영향을 받는 경우에는 파일 확장명-MIME 형식 매핑을 사용자 지정할 수 있습니다. application/octet-stream MIME 형식으로 되돌리려면 Startup.Configure에서 UseStaticFiles 메서드 호출을 수정합니다. 예시:

var provider = new FileExtensionContentTypeProvider();
provider.Mappings[".csv"] = MediaTypeNames.Application.Octet;

app.UseStaticFiles(new StaticFileOptions
{
    ContentTypeProvider = provider
});

매핑을 사용자 지정하는 방법에 대한 자세한 내용은 FileExtensionContentTypeProvider를 참조하세요.

영향을 받는 API

Microsoft.AspNetCore.StaticFiles.FileExtensionContentTypeProvider