open-nomad/command/agent/operator_endpoint_oss.go
Buck Doyle c22d1114d8
Add handling for license requests in OSS (#9963)
This changes the license-fetching endpoint to respond with 204 in
OSS instead of 501. It closes #9827.
2021-02-08 12:53:06 -06:00

21 lines
371 B
Go

// +build !ent
package agent
import (
"net/http"
)
func (s *HTTPServer) LicenseRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
switch req.Method {
case "GET":
resp.WriteHeader(http.StatusNoContent)
return nil, nil
case "PUT":
return nil, CodedError(501, ErrEntOnly)
default:
return nil, CodedError(405, ErrInvalidMethod)
}
}