Skip to content

"-" and "_" characters break normal routing modes #1323

Open
@bgillHub

Description

@bgillHub

We began using Router.attach() with the Matching Mode Template.MODE_STARTS_WITH to support parameters such as "/foo/{var}" with the default RoutingMode (MODE_FIRST_MATCH). Unfortunately, when our URI's started using non-escaped characters, they were the only ones able to receive requests. We had to switch the RoutingMode to MODE_BEST_MATCH to support all URI's. Something occurs while using using MODE_STARTS_WITH and characters such as "_" & "-" that prevents otherwise normal routing using the STARTS_WITH mode.
Example A:

setRoutingMode(MODE_FIRST_MATCH);
attach("/foo/{var}", restletA).setMatchingMode(Template.MODE_STARTS_WITH);
/*foo routes successfully to  restletA*/

Example B:

setRoutingMode(MODE_FIRST_MATCH);
attach("/foo/{var}", restletA).setMatchingMode(Template.MODE_STARTS_WITH);
attach("/fizz-buzz/{var}", restletB).setMatchingMode(Template.MODE_STARTS_WITH);
/*restletB now receives requests, but restletA is unable to receive /foo/n requests */

Thank you for your help,
Brian Gill

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions