Skip to content

Resources with a nested path can match paths without the nested path. #54

@expeehaa

Description

@expeehaa

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}(\/)?$/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions