Skip to content

Backport #5815 to v1.8.0: Warn when http.get or http.head receive extra arguments - #5993

Merged
inancgumus merged 1 commit into
v1.xfrom
backport-5815-http-warn-extra-args
May 15, 2026
Merged

inancgumus merged 1 commit into
v1.xfrom
backport-5815-http-warn-extra-args

Conversation

@mstoykov

Copy link
Copy Markdown
Contributor

What?

Backport of #5815 to the v1.x branch for the v1.8.0 release.

Warns when http.get or http.head are 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 with http.post).

Credit to external contributor @moko-poi for the original change.

Why?

http.get and http.head previously accepted and silently discarded any extra arguments, which made it easy to write subtly broken scripts (for instance, attempting to pass a body to http.get as if it were http.post). Emitting a warning surfaces the mistake to the user without breaking existing scripts.

Checklist

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (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.

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

Warn when http.get or http.head are invoked with extra unexpected arguments
@mstoykov
mstoykov requested a review from a team as a code owner May 15, 2026 09:48
@mstoykov mstoykov added this to the v1.8.0 milestone May 15, 2026
@mstoykov
mstoykov requested review from inancgumus and szkiba and removed request for a team May 15, 2026 09:48
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing May 15, 2026 09:54 — with GitHub Actions Inactive
@mstoykov
mstoykov temporarily deployed to azure-trusted-signing May 15, 2026 09:56 — with GitHub Actions Inactive
@inancgumus
inancgumus merged commit deeb3d5 into v1.x May 15, 2026
56 of 57 checks passed
@inancgumus
inancgumus deleted the backport-5815-http-warn-extra-args branch May 15, 2026 19:40

This branch was previously deployed

1 inactive deployment
azure-trusted-signing โ€” 20238509 Deployed May 15, 2026 by mstoykov via sign-packages #9454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants