diff options
author | Nick Berardi <nick@managedfusion.com> | 2012-03-28 17:05:54 +0400 |
---|---|---|
committer | marcind <marcind@microsoft.com> | 2012-04-03 07:36:15 +0400 |
commit | 6e7594781f71bb3594a0d32f99dba025f156b400 (patch) | |
tree | 547b801730e7b73ce11537265eb69a1eb37931f9 /src/System.Web.Mvc | |
parent | 64721c14d0bc5bd6d96fb2f789fb40b3ff1ec2c7 (diff) |
Added HttpHeadAttribute to MVC as a fix for issue #5
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" /> |