HTTP Client Release 5.1.2 / Mock Server Release 1.1.1: Fix query parameters dropped from requests#58
Merged
dcrockwell merged 2 commits intomainfrom Mar 3, 2026
Merged
HTTP Client Release 5.1.2 / Mock Server Release 1.1.1: Fix query parameters dropped from requests#58dcrockwell merged 2 commits intomainfrom
dcrockwell merged 2 commits intomainfrom
Conversation
## Why This Change Was Made
- The `query()` builder function let callers set query parameters on a request,
and the value was correctly stored on the ClientRequest and copied through
`to_http_request` — but the final URL assembly step silently dropped it.
Every request made with `.query("key=value")` sent the request without any
query parameters. The server never received them. This affected all three
execution modes: `send()`, `stream_yielder()`, and `start_stream()`.
## What Was Changed
- `build_url` in `client.gleam` now appends `?query` to the URL when
`request.query` is `Some(query)`. This fixes `send()` and `start_stream()`.
- `start_httpc_stream` in `internal.gleam` had its own independent URL
construction that also omitted the query string — same fix applied. This
fixes `stream_yielder()`.
- Mock server's `GET /get` endpoint now actually echoes query parameters
(was documented since 1.0.0 but never implemented — the controller only
passed `request.path` to the view).
- 8 regression tests added with exact JSON field assertions covering all
three execution modes, recorder integration, URL-encoded special characters,
and the empty query string edge case.
- Version bumped: http_client 5.1.1 → 5.1.2, mock_server 1.1.0 → 1.1.1.
- CHANGELOGs, READMEs, and release notes updated for both modules.
## Note to Future Engineer
- There are TWO separate URL construction sites: `build_url` in client.gleam
(used by send/start_stream) and inline URL building in `start_httpc_stream`
in internal.gleam (used by stream_yielder). If you ever add a fourth
execution mode, you'll need to make sure it also includes query params —
or better yet, refactor both call sites to share a single URL builder.
- The mock server's GET /get endpoint claimed to echo query params for over
three months before anyone noticed it didn't. The CHANGELOG said it did.
The code said otherwise. Trust the code, not the comments. Or the CHANGELOG.
Especially not the CHANGELOG.
…ing-query Fix query parameters being silently dropped from HTTP requests
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.
Summary
.query()were silently dropped from all outgoing HTTP requestsGET /getendpoint to actually echo query parameters as documentedWhat's in this release
dream_http_client 5.1.2
Query parameters set via the
.query()builder were being stored correctly on the request object but never included in the final URL sent over the wire. This affected all three execution modes (send(),stream_yielder(), andstart_stream()). Any user relying on.query()was unknowingly sending requests without query parameters.The fix appends the query string to the URL in both URL construction sites —
build_urlinclient.gleam(used bysend()andstart_stream()) andstart_httpc_streamininternal.gleam(used bystream_yielder()).Eight regression tests now verify query parameter delivery end-to-end across all execution modes, with exact JSON field assertions, special character handling, and recorder integration.
Full release notes:
modules/http_client/releases/release-5.1.2.mddream_mock_server 1.1.1
The
GET /getendpoint was documented as echoing query parameters since v1.0.0, but the implementation only passed the request path to the view — the query string was silently ignored. Now the JSON response includes a"query"field with the raw query string.Full release notes:
modules/mock_server/releases/release-1.1.1.mdTest plan