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:
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user