only continue to stream when its a stream

This commit is contained in:
Asim Aslam 2019-08-15 20:54:28 +01:00
parent 58bc4c103f
commit 5a5b1b8f6e

View File

@ -42,6 +42,11 @@ type Proxy struct {
// read client request and write to server
func readLoop(r server.Request, s client.Stream) error {
// we don't loop unless its a stream
if !r.Stream() {
return nil
}
// request to backend server
req := s.Request()
@ -266,6 +271,11 @@ func (p *Proxy) ServeRequest(ctx context.Context, req server.Request, rsp server
} else if err != nil {
return err
}
// we don't continue unless its a stream
if !req.Stream() {
return nil
}
}
}