Skip to content

Commit

Permalink
Try to support Server Sent Event.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoveychen committed Dec 20, 2023
1 parent d3e5b75 commit aafdf61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/hub/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ func (hs *HubServer) handleAgentSubmit(w http.ResponseWriter, r *http.Request) {
}
defer submitter.Close()

upResp, err := http.ReadResponse(bufio.NewReader(r.Body), nil)
// To support Server Sent Event, we have to use a short buffer
upResp, err := http.ReadResponse(bufio.NewReaderSize(r.Body, 20), nil)
if err != nil {
if err := conn.Close(err); err != nil {
agentLog.WithError(err).Error("Failed to close connection")
Expand Down

0 comments on commit aafdf61

Please sign in to comment.