Skip to content

Add redirect 301 #6

@fulldump

Description

@fulldump

If a url like /users/ is received, the final slash is removed automatically, and it matches with the following nodes chain:
<root> -> users
However, it should match with:
<root> -> users -> <empty string>
So, the typical CRUD in the examples should be these nodes:

<root>
    users
        <empty>  (handle GET, POST) `/users/`
        {user_id}  (handle GET, PATCH, DELETE) `/users/22`

Finally, if the url matches <root> -> users, (the url_parts array still contains an empty item) so in this case, return an automatic redirect to the same url with slash (better a relative url).

NOTE: this way needs an extra node for users

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions