You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The step that is broken is the redirecting issued from the SubmitLink method - manos just does not find the LinkInfo method, which is the target of the redirection.
Debugging the flow reveals that Manos.Routing.StringMatchOperation.IsMatchInternal does not know to match /r/c43fn~ to /r/{id}~. Indeed, here is the code:
internal static bool IsMatchInternal (string the_string, string input, int start, out DataDictionary data, out int end)
{
if (!StartsWith (input, start, the_string)) {
data = null;
end = start;
return false;
}
data = null;
end = start + the_string.Length;
return true;
}
public static bool StartsWith (string input, int start, string str)
{
if (input.Length < str.Length + start)
return false;
return String.Compare (input, start, str, 0, str.Length, StringComparison.OrdinalIgnoreCase) == 0;
}
This is the only place that tries to match /r/c43fn~ to /r/{id}~. Once it returns false it is all the way down to HTTP error 404.
I am looking at the master branch 33a14b0 pulled a few hours ago (July 10).
The text was updated successfully, but these errors were encountered:
RouteAttribute and ManosModule.Route have different semantics. The ManosModule.Route assumes by defaults MatchType.Simple, while RouteAttribute inherits the logic of its base class - HttpMethodAttribute, which defines MatchType.String as the default.
Adding an explicit MatchType parameter to the RouteAttribute applied to the LinkInfo and Redirector methods from the tutorial fixes the routing.
I guess this is the problem of the actual implementation and the tutorial being out of sync.
Now, I think the fact that RouteAttribute and ManosModule.Route have different defaults for the MatchType is a bug. Don't you?
The scenario displayed in the tutorial at https://github.com/jacksonh/manos/blob/master/docs/tutorial/page-2.md does not work.
The step that is broken is the redirecting issued from the SubmitLink method - manos just does not find the LinkInfo method, which is the target of the redirection.
Debugging the flow reveals that
Manos.Routing.StringMatchOperation.IsMatchInternal
does not know to match /r/c43fn~ to /r/{id}~. Indeed, here is the code:This is the only place that tries to match /r/c43fn~ to /r/{id}~. Once it returns
false
it is all the way down to HTTP error 404.I am looking at the master branch 33a14b0 pulled a few hours ago (July 10).
The text was updated successfully, but these errors were encountered: