1
0
mirror of https://github.com/rancher/steve.git synced 2025-08-31 15:11:31 +00:00

Small fixes and enhancements

This commit is contained in:
Darren Shepherd
2020-02-20 16:06:43 -07:00
parent 265a7a8763
commit 5b94b82bc6
5 changed files with 99 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import (
"net/http"
"github.com/gorilla/mux"
"github.com/rancher/steve/pkg/schemaserver/urlbuilder"
)
type RouterFunc func(h Handlers) http.Handler
@@ -20,6 +21,7 @@ func Routes(h Handlers) http.Handler {
m := mux.NewRouter()
m.UseEncodedPath()
m.StrictSlash(true)
m.Use(urlbuilder.RedirectRewrite)
m.Path("/").Handler(h.APIRoot).HeadersRegexp("Accepts", ".*json.*")
m.Path("/{name:v1}").Handler(h.APIRoot)