mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
http: validating job is provided to avoid nil pointer
This commit is contained in:
@@ -160,6 +160,9 @@ func (s *HTTPServer) jobUpdate(resp http.ResponseWriter, req *http.Request,
|
||||
if err := decodeBody(req, &args, nil); err != nil {
|
||||
return nil, CodedError(400, err.Error())
|
||||
}
|
||||
if args.Job == nil {
|
||||
return nil, CodedError(400, "Job must be specified")
|
||||
}
|
||||
if jobName != "" && args.Job.ID != jobName {
|
||||
return nil, CodedError(400, "Job ID does not match")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user