[codex] Add curl GET data payload support#9
Merged
Conversation
Implement -G/--get query-string data handling for curl, with ordered accumulation for -d/--data, --data-raw, --data-binary, and --data-urlencode. Supported --data-urlencode forms: name=content, =content, and content, using RFC 3986 unreserved encoding so spaces become %20 and characters such as *, &, =, ', and / are percent-encoded. Defer @filename payload forms intentionally: --data-urlencode @file/name@file and -d @file now fail clearly instead of silently doing the wrong thing. The --data newline-stripping distinction from --data-raw/--data-binary remains intentionally unimplemented for this v1.
Review Summary
0 comments posted · Model: |
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
Adds just-bash curl support for the canonical real-curl query-building form:
curl -G URL --data-urlencode 'query=...'Implemented behavior:
-G/--getswitches data payloads onto the URL query string while keeping the request as GET.-d/--data,--data-raw,--data-binary, and--data-urlencodeaccumulate in invocation order and join with&.--data-urlencodesupportsname=content,=content, and plaincontentforms.%20for spaces and percent-encoding for*,=,&,', and/.-Gdata payloads default to POST and setContent-Type: application/x-www-form-urlencodedunless the caller already supplied one.2.14.5.Also resolves existing repo lint blockers in sqlite dot-command code by sanitizing a forwarded dot-command error message and applying the formatter’s sqlite test change.
Deferred intentionally:
@filenamepayload forms for--data-urlencodeand-dare not implemented in this PR. They now fail clearly instead of silently doing the wrong thing.--datanewline-stripping distinction from--data-raw/--data-binaryremains a v1 divergence.Validation
PNPM_HOME=/Users/zax/.local/share/pnpm pnpm --filter just-bash exec vitest run src/commands/curlPNPM_HOME=/Users/zax/.local/share/pnpm pnpm --filter just-bash exec vitest run src/commands/sqlite3/sqlite3.dot-commands.test.tsPNPM_HOME=/Users/zax/.local/share/pnpm pnpm --filter just-bash typecheckPNPM_HOME=/Users/zax/.local/share/pnpm pnpm lint