diff --git a/http_prettifier.go b/http_prettifier.go index 61ae23e..9b8120f 100644 --- a/http_prettifier.go +++ b/http_prettifier.go @@ -16,6 +16,11 @@ func prettifyHTTP(p []byte) []byte { body := p[headSize:] headersPos := proto.MIMEHeadersEndPos(body) + + if headersPos < 5 || headersPos > len(body) { + return p + } + headers := body[:headersPos] content := body[headersPos:]