mirror of https://github.com/status-im/consul.git
consul: Return 404 if no entries found
This commit is contained in:
parent
94df059026
commit
ceb6964547
|
@ -51,6 +51,12 @@ func (s *HTTPServer) KVSGet(resp http.ResponseWriter, req *http.Request, args *s
|
|||
return nil, err
|
||||
}
|
||||
setIndex(resp, out.Index)
|
||||
|
||||
// Check if we get a not found
|
||||
if len(out.Entries) == 0 {
|
||||
resp.WriteHeader(404)
|
||||
return nil, nil
|
||||
}
|
||||
return out.Entries, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue