From d6b273332b9f8b51b4e9184301ba3bc87c0d17a3 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Mon, 26 Apr 2021 22:39:08 +0300 Subject: [PATCH] Fix size calculation (#434) * Fix size calculation --- CHANGELOG.md | 1 + pkg/runner/simple.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b24c438..46457ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - master - New - Changed + - Fixed the way the "size" is calculated, it should match content-length now - Fixed output writing so it doesn't silently fail if it needs to create directories recursively - v1.3.0 diff --git a/pkg/runner/simple.go b/pkg/runner/simple.go index e13415e..e59288a 100644 --- a/pkg/runner/simple.go +++ b/pkg/runner/simple.go @@ -13,7 +13,6 @@ import ( "strconv" "strings" "time" - "unicode/utf8" "github.com/ffuf/ffuf/pkg/ffuf" ) @@ -147,7 +146,7 @@ func (r *SimpleRunner) Execute(req *ffuf.Request) (ffuf.Response, error) { } if respbody, err := ioutil.ReadAll(httpresp.Body); err == nil { - resp.ContentLength = int64(utf8.RuneCountInString(string(respbody))) + resp.ContentLength = int64(len(string(respbody))) resp.Data = respbody }