mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
15 lines
457 B
C#
15 lines
457 B
C#
using System.Web.Mvc;
|
|
|
|
namespace BuildFeed.Code
|
|
{
|
|
// this class is a hacky workaround because Microsoft just don't feel like caching the correct content type
|
|
public class CustomContentTypeAttribute : ActionFilterAttribute
|
|
{
|
|
public string ContentType { get; set; }
|
|
|
|
public override void OnResultExecuted(ResultExecutedContext filterContext)
|
|
{
|
|
filterContext.HttpContext.Response.ContentType = ContentType;
|
|
}
|
|
}
|
|
} |