diff --git a/tap/extensions/http/main.go b/tap/extensions/http/main.go index bb15d85b4..4327829c9 100644 --- a/tap/extensions/http/main.go +++ b/tap/extensions/http/main.go @@ -100,7 +100,6 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co http2Assembler = createHTTP2Assembler(b) } - dissected := false switchingProtocolsHTTP2 := false for { if switchingProtocolsHTTP2 { @@ -121,7 +120,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co } else if err != nil { continue } - dissected = true + superIdentifier.Protocol = &http11protocol } else if isClient { var req *http.Request switchingProtocolsHTTP2, req, err = handleHTTP1ClientStream(b, tcpID, counterPair, superTimer, emitter, options) @@ -130,7 +129,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co } else if err != nil { continue } - dissected = true + superIdentifier.Protocol = &http11protocol // In case of an HTTP2 upgrade, duplicate the HTTP1 request into HTTP2 with stream ID 1 if switchingProtocolsHTTP2 { @@ -161,14 +160,14 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co } else if err != nil { continue } - dissected = true + superIdentifier.Protocol = &http11protocol } } - if !dissected { + if superIdentifier.Protocol == nil { return err } - superIdentifier.Protocol = &http11protocol + return nil }