diff options
Diffstat (limited to 'src/System.Web.Mvc')
-rw-r--r-- | src/System.Web.Mvc/HttpHeadAttribute.cs | 15 | ||||
-rw-r--r-- | src/System.Web.Mvc/System.Web.Mvc.csproj | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/System.Web.Mvc/HttpHeadAttribute.cs b/src/System.Web.Mvc/HttpHeadAttribute.cs new file mode 100644 index 00000000..89b3a2fe --- /dev/null +++ b/src/System.Web.Mvc/HttpHeadAttribute.cs @@ -0,0 +1,15 @@ +using System.Reflection; + +namespace System.Web.Mvc +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] + public sealed class HttpHeadAttribute : ActionMethodSelectorAttribute + { + private static readonly AcceptVerbsAttribute _innerAttribute = new AcceptVerbsAttribute(HttpVerbs.Head); + + public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo) + { + return _innerAttribute.IsValidForRequest(controllerContext, methodInfo); + } + } +} diff --git a/src/System.Web.Mvc/System.Web.Mvc.csproj b/src/System.Web.Mvc/System.Web.Mvc.csproj index 7b8cb5c0..b1eb3c0c 100644 --- a/src/System.Web.Mvc/System.Web.Mvc.csproj +++ b/src/System.Web.Mvc/System.Web.Mvc.csproj @@ -95,6 +95,7 @@ <Compile Include="CompareAttribute.cs" /> <Compile Include="ChildActionValueProvider.cs" /> <Compile Include="ChildActionValueProviderFactory.cs" /> + <Compile Include="HttpHeadAttribute.cs" /> <Compile Include="IEnumerableValueProvider.cs" /> <Compile Include="DataTypeUtil.cs" /> <Compile Include="Html\DisplayNameExtensions.cs" /> |