mirror of
https://github.com/niusmallnan/steve.git
synced 2025-08-31 12:48:54 +00:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user