From a77ce7abad162a48f79bbcf99c3756506bb02ee6 Mon Sep 17 00:00:00 2001 From: r3inbowari Date: Sat, 10 Dec 2022 06:02:02 +0800 Subject: [PATCH] fix: wrong upload value --- speedtest/request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speedtest/request.go b/speedtest/request.go index 08d5f34..64c1dff 100644 --- a/speedtest/request.go +++ b/speedtest/request.go @@ -217,7 +217,7 @@ func downloadRequest(ctx context.Context, doer *http.Client, dlURL string, w int func uploadRequest(ctx context.Context, doer *http.Client, ulURL string, w int) error { size := ulSizes[w] - reader := NewRepeatReader(size*100*10 - 51) + reader := NewRepeatReader((size*100 - 51) * 10) req, err := http.NewRequestWithContext(ctx, http.MethodPost, ulURL, reader) req.ContentLength = reader.ContentLength if err != nil {