Skip to content

Path matching fails if the request has a trailing slash #120

@plietar

Description

@plietar
app <- webfakes::new_app()
app$get("/:name/", function(req, res) res$send("OK"))

server <- webfakes::local_app_process(app)

# This succeeds
httr2::request(server$url("/foo")) |> httr2::req_perform()

# This fails with a "HTTP 404 Not Found."
httr2::request(server$url("/foo/")) |> httr2::req_perform()

I'd at least expect the second request to succeed, given that the route definition has the trailing slash. I'm on the fence whether the first one should.

If I use a literal route definition (ie. app$get("/foo/", ...)), then I get the opposite result: the request with the trailing slash succeeds but not the one without.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions