From 58a1eac2479a7026ffcfeba74674f17068a137f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Mert=20Y=C4=B1ld=C4=B1ran?= Date: Tue, 16 Nov 2021 01:58:22 +0300 Subject: [PATCH] Set `response.bodySize` to `0` if it's negative (#466) --- tap/extensions/http/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tap/extensions/http/main.go b/tap/extensions/http/main.go index d24a8d478..4a160f1f5 100644 --- a/tap/extensions/http/main.go +++ b/tap/extensions/http/main.go @@ -143,6 +143,10 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, } } + if resDetails["bodySize"].(float64) < 0 { + resDetails["bodySize"] = 0 + } + if item.Protocol.Version == "2.0" { service = fmt.Sprintf("%s://%s", scheme, authority) } else {