Skip to content

* doesn't match an empty string #32

@swenson

Description

@swenson

I would expect * in a route to match any string, including the empty string. It doesn't, though:

package main

import (
    "fmt"

    "github.com/labstack/echo"
)

func okay(context *echo.Context) {
    context.String(200, "")
}

func main() {
    e := echo.New()
    e.Post("members*", okay)
    handler, ech := e.Router.Find("POST", "members", nil)
    fmt.Printf("%+v %+v\n", handler, ech)
}

Prints <nil>, <nil>.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions