Skip to content

Dispatcher incorrectly handles trailing slashes #195

@jmpurtle

Description

@jmpurtle

In development of a MCVE, I discovered that when one attempts to use the built in Object Dispatching mechanism on an url such as '/movies/', Webcore delivers a 404 response and navigating to '/movies' correctly renders as a call.

127.0.0.1 - - [11/May/2020 16:26:23] "GET / HTTP/1.1" 200 13
127.0.0.1 - - [11/May/2020 16:26:29] "GET /movies HTTP/1.1" 200 25
web.app.wcmdb.movie.controller:MoviesController.__call__() takes 1 positional argument but 2 were given
127.0.0.1 - - [11/May/2020 16:26:33] "GET /movies/ HTTP/1.1" 404 0

After some discussion, it appears that the splitting of the provided path occurs twice and the second instance does not handle a case where the split will return a single-element empty string on an empty string split and subsequently passed to RemainderArgsExtension.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions