File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -295,7 +295,7 @@ You may use the following placeholders in the body (`endpoints[].body`):
295295- ` [ENDPOINT_GROUP]` (resolved from `endpoints[].group`)
296296- ` [ENDPOINT_URL]` (resolved from `endpoints[].url`)
297297- ` [LOCAL_ADDRESS]` (resolves to the local IP and port like `192.0.2.1:25` or `[2001:db8::1]:80`)
298- - ` [RANDOM_STRING_N]` (resolves to a random string of numbers and letters of length N)
298+ - `[RANDOM_STRING_N]` (resolves to a random string of numbers and letters of length N (max : 8192) )
299299
300300
301301# ## External Endpoints
Original file line number Diff line number Diff line change @@ -344,6 +344,9 @@ func (e *Endpoint) getParsedBody() string {
344344 if err == nil {
345345 body = randRegex .ReplaceAllStringFunc (body , func (match string ) string {
346346 n , _ := strconv .Atoi (match [15 : len (match )- 1 ])
347+ if n > 8192 {
348+ n = 8192 // Limit the length of the random string to 8192 bytes to avoid excessive memory usage
349+ }
347350 const availableCharacterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
348351 b := make ([]byte , n )
349352 for i := range b {
You can’t perform that action at this time.
0 commit comments