Repository navigation
Backport #5815 to v1.8.0: Warn when http.get or http.head receive extra arguments - #5993
Merged
Merged
Conversation
Warn when http.get or http.head are invoked with extra unexpected arguments
mstoykov
requested review from
inancgumus and
szkiba
and removed request for
a team
May 15, 2026 09:48
szkiba
approved these changes
May 15, 2026
mstoykov
temporarily deployed
to
azure-trusted-signing
May 15, 2026 09:54 — with
GitHub Actions
Inactive
mstoykov
temporarily deployed
to
azure-trusted-signing
May 15, 2026 09:56 — with
GitHub Actions
Inactive
inancgumus
approved these changes
May 15, 2026
This branch was previously deployed
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.
What?
Backport of #5815 to the v1.x branch for the v1.8.0 release.
Warns when
http.getorhttp.headare invoked with extra unexpected arguments. These methods only accept(url, params), so any additional positional arguments are silently ignored โ this change logs a warning to help users catch mistakes (e.g. passing a body argument by analogy withhttp.post).Credit to external contributor @moko-poi for the original change.
Why?
http.getandhttp.headpreviously accepted and silently discarded any extra arguments, which made it easy to write subtly broken scripts (for instance, attempting to pass a body tohttp.getas if it werehttp.post). Emitting a warning surfaces the mistake to the user without breaking existing scripts.Checklist
make check) and all pass.Checklist: Documentation (only for k6 maintainers and if relevant)
Please do not merge this PR until the following items are filled out.
Related PR(s)/Issue(s)