From 5a5b1b8f6e0ad129ae2a273167b304a13c56f440 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 15 Aug 2019 20:54:28 +0100 Subject: [PATCH] only continue to stream when its a stream --- proxy/mucp/mucp.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proxy/mucp/mucp.go b/proxy/mucp/mucp.go index 3f54d9c0..9df28aec 100644 --- a/proxy/mucp/mucp.go +++ b/proxy/mucp/mucp.go @@ -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 + } } }