Fix size calculation (#434)

* Fix size calculation
This commit is contained in:
Joona Hoikkala 2021-04-26 22:39:08 +03:00 committed by GitHub
parent 4daf2b6fcb
commit d6b273332b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -2,6 +2,7 @@
- master - master
- New - New
- Changed - 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 - Fixed output writing so it doesn't silently fail if it needs to create directories recursively
- v1.3.0 - v1.3.0

View File

@ -13,7 +13,6 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"unicode/utf8"
"github.com/ffuf/ffuf/pkg/ffuf" "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 { 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 resp.Data = respbody
} }