Skip to content

Commit

Permalink
http_client(): Don't drop responses with empty Content (#2696)
Browse files Browse the repository at this point in the history
Close #2695
  • Loading branch information
hillu committed May 23, 2023
1 parent 9d40768 commit d869dea
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions vql/networking/http_client.go
Expand Up @@ -438,15 +438,16 @@ func (self *_HttpPlugin) Call(
n, err := io.ReadFull(http_resp.Body, buf)
if n > 0 {
response.Content = string(buf[:n])
select {
case <-ctx.Done():
return
case output_chan <- response:
}
} else if err == io.EOF {
response.Content = ""
} else if err != nil {
break
}

if err == io.EOF {
break
select {
case <-ctx.Done():
return
case output_chan <- response:
}

if err != nil {
Expand Down

0 comments on commit d869dea

Please sign in to comment.