1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

Add context.FindClosest(n) to find closest paths - useful for 404 pages to suggest valid pages

Former-commit-id: 90ff7c9da5369df5bd99fbbecf9955a8c555fea5
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-12-16 02:00:42 +02:00
parent 4efe9004fa
commit a3f944b884
11 changed files with 137 additions and 30 deletions

View File

@@ -388,19 +388,7 @@ func WithSitemap(startURL string) Configurator {
}
for _, r := range app.GetRoutes() {
if !r.IsOnline() {
continue
}
if r.Subdomain != "" {
continue
}
if r.Method != MethodGet {
continue
}
if len(r.Tmpl().Params) > 0 {
if !r.IsStatic() || r.Subdomain != "" {
continue
}
@@ -478,7 +466,7 @@ func WithSitemap(startURL string) Configurator {
}
}
} else {
app.HandleMany("GET HEAD", s.Path, handler)
app.HandleMany("GET HEAD OPTIONS", s.Path, handler)
}
}