cleanup: Fix API root header

The header defined in RFC 9110[1] is "Accept", not "Accepts". This
change corrects the route filter. Since this API is not documented and
the header was plainly incorrect, no attempt is made at backwards
compatibility.

[1] https://www.rfc-editor.org/rfc/rfc9110.html#name-accept
This commit is contained in:
Colleen Murphy
2022-10-10 11:52:26 -07:00
parent 18afa8868f
commit 70ea282861

View File

@@ -22,7 +22,7 @@ func Routes(h Handlers) http.Handler {
m.StrictSlash(true)
m.Use(urlbuilder.RedirectRewrite)
m.Path("/").Handler(h.APIRoot).HeadersRegexp("Accepts", ".*json.*")
m.Path("/").Handler(h.APIRoot).HeadersRegexp("Accept", ".*json.*")
m.Path("/{name:v1}").Handler(h.APIRoot)
m.Path("/v1/{type}").Handler(h.K8sResource)