Skip to content

Stop curl expanding a base URL into several requests - #29

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/curl-url-globbing
Nov 7, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/curl-url-globbing

Conversation

@dmccoystephenson

@dmccoystephenson dmccoystephenson commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

  • A constant globoff line is added to the curl config, directly after url. A base URL containing {} or [] is now sent as one request to that literal path, rather than being expanded by the curl tool into several requests.
  • Quoting could not have prevented this, because globbing is applied after the config line is parsed. The libcurl transport never globbed, so the two transports now agree.
  • README.md ("How a report is sent") names globoff alongside proto.
  • The curl argv is unchanged (curl -q --silent --config -), and no program-supplied value is added to the config.

Closes #28

Test plan

  • aBaseUrlIsNeverExpandedIntoSeveralRequests was added and registered in tests[].
  • The test failed before the fix with make test: 74 tests, 3 failed checks (2 requests, path /a/api/metrics, 1 Logger line).
  • The suite passed after the fix with make test (g++, C++11): 74 tests, 0 failed checks.
  • curlConfigFixesEveryOptionAndQuotesEveryValue was updated for the new line.
  • CI is green on all 11 jobs. clang++, C++17 and C++20, libcurl, the sanitizers, macOS and Windows were verified by CI alone, not run locally.

Merge

Autonomous merge is held. This diff adds to the curl config, which is the security boundary the README documents. globoff is not literally listed among the do-not-auto-merge paths, but it is the same kind of change as the listed proto line, so the decision is left to the owner.

Issues not picked this cycle

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

🤖 Generated with Claude Code

curl's URL globbing happens after the config line is parsed, so quoting
does not reach it: a base URL with {} or [] became several requests, to
paths the program never named, and their statuses ran together into
one that could not be read. libcurl does not glob, so only the default
transport did this.

Closes #28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric, scored against commit 7d37d6f:

  • Scope: PASS — 3 files and 20 added lines, all serving A base URL with {} or [] is expanded by curl into several requests #28.
  • Tests-new: PASS — no public method was added. The new curlConfig line is covered by the exact-match test and by aBaseUrlIsNeverExpandedIntoSeveralRequests.
  • Tests-fix: PASS — the test was written and run before the fix. make test gave 74 tests, 3 failed checks without the fix and 74 tests, 0 failed checks with it.
  • Sibling structure: PASS — no new file. The test follows its neighbours (StubServer, Log, CHECK_EQ).
  • Sibling renames: PASS — nothing was renamed.
  • Docs: PASS — every Phase 7 row was checked. Only "How a report is sent" was affected, and it now names globoff.
  • Issue resolution: PASS — curlConfig, the surface named in A base URL with {} or [] is expanded by curl into several requests #28, is changed.
  • CI: PASS — all 11 jobs passed on the PR head.
  • Registered: PASS — the new test appears in tests[], and the count rose from 73 to 74.
  • C++11: PASS — the Makefile default built clean under -Werror, and both c++11 legs passed in CI.
  • No new dependency: PASS — no #include or link flag was added.
  • Never throws: PASS — one more string append sits inside curlConfig, whose only caller is send, and deliver wraps send in try.
  • Curl argv fixed: PASS — the argv is unchanged, and the new line is a constant carrying no program-supplied value.
  • Version triple: PASS — unchanged.
  • Sanitizers: PASS — both linux-sanitizers jobs passed.

Limits of this verification:

  • {} is exercised end to end, but [] is covered only by globoff appearing in the exact-match config test.
  • With globbing off, { and } reach the server unencoded. That is what the program supplied, but a strict server may reject it. A rejection is now one logged failure rather than several requests.
  • The local C++17 run reused the C++11 binary, so C++17 and C++20 are verified by CI alone.

Merge is held for the owner, as the PR description explains.

This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit ac94313 into main Nov 7, 2026
11 checks passed
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.

A base URL with {} or [] is expanded by curl into several requests

1 participant