I have this code:
[SkipFilter(typeof(AntiCrossSiteRequestForgeryFilter))]
public void index()
If you also register this:
RoutingModuleEx.Engine.Add(
new PatternRoute("Area Route", "/<area>/<controller>/[action]")
.DefaultForAction().Is("index")
);
Then the ActionMetaDescriptor will not contain information about the correct
index method; i.e. the collection of skip filters;
/// <summary>
/// Pendent
/// </summary>
/// <param name="filterType">Type of the filter.</param>
/// <returns></returns>
public bool ShouldSkipFilter(Type filterType)
{
foreach(SkipFilterAttribute skip in
actionMetaDescriptor.SkipFilters)
{
if (skip.FilterType == filterType)
{
return true;
}
}
return false;
}
will _NOT_ be found/correct/filled up, i.e. the filter will not be skipped
and the app crashes (or rather denies access).
Part 2
I was also wondering why this part is here:
if (parts.Length < 2)
{
throw new UrlTokenizerException("Url smaller than 2 tokens");
}
In DefaultUrlTokenizer.ExtractAreaControllerAction(.)
?
Because if I have
www.site.com
there are no parts. I hence can't register route pattern "/" and place that
into a controller/action-pair, or is there a way around this? The
documentation states:
Site root
As an user I should be able to register a definition mapping the site root
(aka ~/) to an area (optional), controller and action.
Pattern:
/
Name:
siteroot (set by the user)
Area:
null
controller
Home
action
index
Request URL / (or virtualdir/) should match the above rule.
Request URL /something (or virtualdir/something) should NOT match the above
rule.
Url generation for the above rule MUST use the name
Here: http://using.castleproject.org/display/MR/Routing+Spec
But that doesn't work either.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---