Limit number of log entries returned. Closes #423

This commit is contained in:
Gabe Kangas
2020-12-05 16:55:19 -08:00
parent 4a4639a523
commit 40e63546cb
2 changed files with 15 additions and 7 deletions

View File

@@ -32,7 +32,10 @@ func GetWarnings(w http.ResponseWriter, r *http.Request) {
response := make([]logsResponse, 0)
for i := 0; i < len(logs); i++ {
response = append(response, fromEntry(logs[i]))
logEntry := logs[i]
if logEntry != nil {
response = append(response, fromEntry(logEntry))
}
}
w.Header().Set("Content-Type", "application/json")