feat(collection-docs):Res scripting methods improvements - #28
Open
sachin-bruno wants to merge 4 commits into
Open
feat(collection-docs):Res scripting methods improvements#28sachin-bruno wants to merge 4 commits into
sachin-bruno wants to merge 4 commits into
Conversation
vasharma05-bruno
left a comment
Contributor
There was a problem hiding this comment.
Type suggestions for the new functions — the code leans on any in several spots that can be tightened to document the actual shapes flowing through the res object.
vasharma05-bruno
suggested changes
Aug 6, 2026
vasharma05-bruno
left a comment
Contributor
There was a problem hiding this comment.
As discussed, the Buffer management of response data present in this PR is already handled in the RequestExecutor, which is being passed here, and hence the data from RequestExecutor, with type RunRequestResponse must be reused here, rather than recalculating.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref: BRU-3837
Problem
The playground's res object did not fully match the app or the browser executor's response shape. It had no structured header list, getHeader was case sensitive, and responseTime and url read fields (responseTime, request) that the browser fetch response does not provide, so they came back null.
Fix
This adds a new read only res.headerList with structured reads (get, all, has, filter, map, and similar), while any attempt to modify response headers throws. It also changes responseTime and url to fall back to the executor's duration and url fields, makes getHeader case insensitive, and updates setBody to deep clone the value and refresh the data buffer so getSize stays correct.