namespace OAuthAuthorizationServer.Code { using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; /// /// Represents an attribute that is used to add HTTP Headers to a Controller Action response. /// public class HttpHeaderAttribute : ActionFilterAttribute { /// /// Gets or sets the name of the HTTP Header. /// public string Name { get; set; } /// /// Gets or sets the value of the HTTP Header. /// public string Value { get; set; } /// /// Initializes a new instance of the class. /// public HttpHeaderAttribute(string name, string value) { Name = name; Value = value; } /// /// Called by the MVC framework after the action result executes. /// /// The filter context. public override void OnResultExecuted(ResultExecutedContext filterContext) { filterContext.HttpContext.Response.AppendHeader(Name, Value); base.OnResultExecuted(filterContext); } } }