A resource which defines .nested_path to return a non-empty string can match just the root path without the nested path. I would expect that, if the nested path is not empty, it must be present in the given path to match, because this behaviour can hide resources that have an empty nested path.
This appears to be due to this regex.
|
/^#{root_path}(\/|\/(\d+)(#{nested_path})?)?$/ |
I think this regex should rather be the following.
/^#{root_path}\/(|(\d+))#{nested_path}(\/)?$/
A resource which defines
.nested_pathto return a non-empty string can match just the root path without the nested path. I would expect that, if the nested path is not empty, it must be present in the given path to match, because this behaviour can hide resources that have an empty nested path.This appears to be due to this regex.
crumble/src/resource/resource.cr
Line 98 in e964b25
I think this regex should rather be the following.
/^#{root_path}\/(|(\d+))#{nested_path}(\/)?$/