Unclear behaviour of `*` in routes
@aldas ci sta già lavorando.
Dal 6/4/2024.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Issue Description
Checklist
- Dependencies installed
- No typos
- Searched existing issues and docs
Expected behaviour
- If I have static text in a route that static text is guaranteed to show up in
c.Path()orc.Request().RequestURI - Multiple instances of
*in routes play nicely with each other
Actual behaviour
- If I have static text in a route, another route with
*may "absorb it" - Multiple instances of
*in routes do NOT seem to play nicely with each other
Steps to reproduce
Trying to build router for: https://github.com/opencontainers/distribution-spec/blob/main/spec.md
handler := func (c echo.Context) err {
fmt.Printf("%s\n", c.Path())
}
e := echo.New()
v2 := e.Group("/v2")
v2.DELETE("/*/blobs/:digest", handler)
v2.GET("/*/blobs/:digest", handler)
v2.HEAD("/*/blobs/:digest", handler)
v2.DELETE("/*/manifests/:ref", handler)
v2.GET("/*/manifests/:ref", handler)
v2.HEAD("/*/manifests/:ref", handler)
v2.PUT("/*/manifests/:ref", handler)
v2.GET("/*/tags/list", handler)
v2.GET("/*/blobs/uploads/:ref", handler)
v2.PATCH("/*/blobs/uploads/:ref", handler)
v2.POST("/*/blobs/uploads", handler)
v2.PUT("/*/blobs/uploads/:ref", handler)
v2.GET("", handler)
Run:
curl -ik https://localhost:8080/v2/foo/bar/baz/tags/list
# /v2/*/blobs/uploads/:ref
Result outputs /v2/*/blobs/uploads/:ref when it should output /v2/*/tags/list.
Version/commit
v4.11.4
- Lingua principale
- Go
- Stelle
- 32.7k
- Fork
- 2.8k
- Merge medio
- 9h 39m
- PR unite (30g)
- 6
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di labstack/echo
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di labstack/echo
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
googleapis/librarian#7670 · 2 commenti ·