Skip to content

Commit

Permalink
x-pack/filebeat/input/httpjson: avoid fruitless map allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
efd6 committed Sep 6, 2023
1 parent 13c58d3 commit 5ad7624
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions x-pack/filebeat/input/httpjson/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,16 +847,13 @@ func responseToMap(r *response) (mapstr.M, error) {
}
respMap := map[string]interface{}{
"header": make(mapstr.M),
"body": make(mapstr.M),
"body": r.body,
}

for key, value := range r.header {
respMap["header"] = mapstr.M{
key: value,
}
}
respMap["body"] = r.body

return respMap, nil
}

Expand Down

0 comments on commit 5ad7624

Please sign in to comment.