tool_operate: drop the scheme-guessing in the -G handling#20992
tool_operate: drop the scheme-guessing in the -G handling#20992
Conversation
Prior to this, -G would override the scheme set with --proto-default and revert back to guessing the scheme based on the hostname. Add test 2008 to verify the fix Spotted by Codex Security
There was a problem hiding this comment.
Pull request overview
This PR fixes curl tool -G handling so it no longer reverts to hostname-based scheme guessing when --proto-default is set, and adds a regression test to ensure the intended scheme is preserved in proxy absolute-form requests.
Changes:
- Update
append2query()insrc/tool_operate.cto stop reintroducing a guessed scheme when reconstructing the URL after appending query parameters. - Add new test case
test2008to cover-Gwith--proto-defaulton a schemeless hostname that would otherwise trigger scheme guessing. - Register
test2008in the tests data Makefile.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/data/test2008 | New regression test covering -G + --proto-default behavior with proxy usage |
| tests/data/Makefile.am | Adds test2008 to the test suite list |
| src/tool_operate.c | Stops append2query() from reintroducing guessed schemes when rebuilding URLs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
augment review |
🤖 Augment PR SummarySummary: Fixes curl tool Changes:
Why: Prevents 🤖 Was this summary useful? React with 👍 or 👎 |
Prior to this, -G would override the scheme set with --proto-default and revert back to guessing the scheme based on the hostname.
Add test 2008 to verify the fix
Spotted by Codex Security