mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 20:41:57 +00:00
allow handle same param path types with different macro functions as well, a use case: #1058
Former-commit-id: e7dcc5c0d9a2e3569e0f49303ff342bb8748baf5
This commit is contained in:
@@ -142,7 +142,9 @@ func (repo *repository) getAll() []*Route {
|
||||
|
||||
func (repo *repository) register(route *Route) {
|
||||
for i, r := range repo.routes {
|
||||
if route.Equal(r) {
|
||||
// 14 August 2019 allow register same path pattern with different macro functions,
|
||||
// see #1058
|
||||
if route.DeepEqual(r) {
|
||||
// replace existing with the latest one.
|
||||
repo.routes = append(repo.routes[:i], repo.routes[i+1:]...)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user