Clarify comments
This commit is contained in:
parent
61be181f6f
commit
35c2083422
|
@ -52,6 +52,7 @@ type unboundEndpoint func(s *HTTPServer, resp http.ResponseWriter, req *http.Req
|
|||
var endpoints map[string]unboundEndpoint
|
||||
|
||||
// allowedMethods is a map from endpoint prefix to supported HTTP methods.
|
||||
// An empty slice means an endpoint handles OPTIONS requests and MethodNotFound errors itself.
|
||||
var allowedMethods map[string][]string
|
||||
|
||||
// registerEndpoint registers a new endpoint, which should be done at package
|
||||
|
|
|
@ -59,7 +59,8 @@ func init() {
|
|||
registerEndpoint("/v1/operator/autopilot/configuration", []string{"GET", "PUT"}, (*HTTPServer).OperatorAutopilotConfiguration)
|
||||
registerEndpoint("/v1/operator/autopilot/health", []string{"GET"}, (*HTTPServer).OperatorServerHealth)
|
||||
registerEndpoint("/v1/query", []string{"GET", "POST"}, (*HTTPServer).PreparedQueryGeneral)
|
||||
// because prepared queries have more complex rules for allowed methods, handle that in the endpoint.
|
||||
// specific prepared query endpoints have more complex rules for allowed methods, so
|
||||
// the prefix is registered with no methods.
|
||||
registerEndpoint("/v1/query/", []string{}, (*HTTPServer).PreparedQuerySpecific)
|
||||
registerEndpoint("/v1/session/create", []string{"PUT"}, (*HTTPServer).SessionCreate)
|
||||
registerEndpoint("/v1/session/destroy/", []string{"PUT"}, (*HTTPServer).SessionDestroy)
|
||||
|
|
Loading…
Reference in New Issue