-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Interpolate variables into MultiHTTP request bodies #713
Merged
Conversation
This file contains 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
The-9880
commented
May 29, 2024
…expression that interpolates referenced variables.
The-9880
force-pushed
the
multihttp-body-vars
branch
from
May 29, 2024 19:53
7e9deff
to
f8daec4
Compare
nadiamoe
previously approved these changes
May 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a small nit about t parallelism
nadiamoe
approved these changes
May 30, 2024
The-9880
added a commit
that referenced
this pull request
Jun 10, 2024
* Chore(deps): Bump golang.org/x/net from 0.24.0 to 0.25.0 * Chore(deps): Bump the prometheus-go group across 1 directory with 2 updates * Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 * Update to grafana-build-tools v0.11.0 (#705) * Remove adhoc and traceroute feature flags. (#707) * Chore(deps): Bump github.com/KimMachineGun/automemlimit * checks/test: make timer big enough for context cancel to be picked up * Fix: Interpolate variables into MultiHTTP request bodies (#713) * Chore(deps): Bump github.com/prometheus/prometheus (#716) * Chore(deps): Bump github.com/rs/zerolog from 1.32.0 to 1.33.0 * --- updated-dependencies: - dependency-name: kernel.org/pub/linux/libs/security/libcap/cap dependency-type: direct:production update-type: version-update:semver-patch ... * MultiHttp script should decode the payload as a string and replace the variable placeholders with the values. The result should be assigned to the request body. (#717) * Build(deps): Bump golang.org/x/net from 0.25.0 to 0.26.0 * Enable K6 by default in agent deployments (#722) Signed-off-by: Anant Sharma <[email protected]>
Closed
The-9880
added a commit
that referenced
this pull request
Jun 11, 2024
* Chore(deps): Bump golang.org/x/net from 0.24.0 to 0.25.0 * Chore(deps): Bump the prometheus-go group across 1 directory with 2 updates * Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 * Update to grafana-build-tools v0.11.0 (#705) * Remove adhoc and traceroute feature flags. (#707) * Chore(deps): Bump github.com/KimMachineGun/automemlimit * checks/test: make timer big enough for context cancel to be picked up * Fix: Interpolate variables into MultiHTTP request bodies (#713) * Chore(deps): Bump github.com/prometheus/prometheus (#716) * Chore(deps): Bump github.com/rs/zerolog from 1.32.0 to 1.33.0 * --- updated-dependencies: - dependency-name: kernel.org/pub/linux/libs/security/libcap/cap dependency-type: direct:production update-type: version-update:semver-patch ... * MultiHttp script should decode the payload as a string and replace the variable placeholders with the values. The result should be assigned to the request body. (#717) * Build(deps): Bump golang.org/x/net from 0.25.0 to 0.26.0 * Enable K6 by default in agent deployments (#722) * Fix: deprecate --features and warn user (#726) * k6runner: use check context for http request (#715) Signed-off-by: Anant Sharma <[email protected]>
Merged
The-9880
added a commit
that referenced
this pull request
Jun 13, 2024
* Chore(deps): Bump golang.org/x/net from 0.24.0 to 0.25.0 * Chore(deps): Bump the prometheus-go group across 1 directory with 2 updates * Chore(deps): Bump github.com/mccutchen/go-httpbin/v2 * Update to grafana-build-tools v0.11.0 (#705) * Remove adhoc and traceroute feature flags. (#707) * Chore(deps): Bump github.com/KimMachineGun/automemlimit * checks/test: make timer big enough for context cancel to be picked up * Fix: Interpolate variables into MultiHTTP request bodies (#713) * Chore(deps): Bump github.com/prometheus/prometheus (#716) * Chore(deps): Bump github.com/rs/zerolog from 1.32.0 to 1.33.0 * --- updated-dependencies: - dependency-name: kernel.org/pub/linux/libs/security/libcap/cap dependency-type: direct:production update-type: version-update:semver-patch ... * MultiHttp script should decode the payload as a string and replace the variable placeholders with the values. The result should be assigned to the request body. (#717) * Build(deps): Bump golang.org/x/net from 0.25.0 to 0.26.0 * Enable K6 by default in agent deployments (#722) * Fix: deprecate --features and warn user (#726) * k6runner: use check context for http request (#715) Signed-off-by: Anant Sharma <[email protected]>
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.
Addresses #637.
Writing
encoding.b64decode(<BODY>)
into the template doesn't let us catch where the user is referencing variables.We should either:
"literal " +vars['var1']+ " more text " +vars['var2']
) directly into the template, or$body
and replace any interpolated variables in the template code itself.For option 1,
buildBody
could likely just return the result ofperformVariableExpansion
on the body payload.Option 2 is probably better practice as the user input won't escape the string; however users who are trying to execute arbitrary code could just leverage scripted checks.