From bd6809b4f02c60e0e17fa8a5e27dfd5b5d0b2dcd Mon Sep 17 00:00:00 2001 From: ankur22 Date: Wed, 29 May 2024 15:50:36 +0100 Subject: [PATCH] Revert request.size to sync request.size works with the same data as request.headers and request.postData, both of which are sync APIs, therefore size is safe to be a sync since data is loaded from memory. --- browser/request_mapping.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/browser/request_mapping.go b/browser/request_mapping.go index 567164e82..942477311 100644 --- a/browser/request_mapping.go +++ b/browser/request_mapping.go @@ -57,11 +57,7 @@ func mapRequest(vu moduleVU, r *common.Request) mapping { return mapResponse(vu, resp), nil }) }, - "size": func() *goja.Promise { - return k6ext.Promise(vu.Context(), func() (any, error) { - return r.Size(), nil - }) - }, + "size": r.Size, "timing": r.Timing, "url": r.URL, }