Repository navigation
fix: quote every part of the copied curl command - #26
Merged
Merged
Conversation
The URL, the method and header names went into the command as they were. A URL with an apostrophe in it produced a command the shell could not read, and one written for the purpose ran whatever followed the quote when the command was pasted. Each part is now a single quoted argument.
heoblitz
approved these changes
Oct 15, 2026
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
The "copy as curl" command in the Network detail quoted header values and the body, but put the URL, the method and header names in as they were. A URL with an apostrophe (
?q=it's) produced a command the shell could not read, and a URL written for the purpose (';<command>;'is legal in a path or query, and URLs come from servers as much as from the app) ran whatever followed the quote when the command was pasted. Every part is now a single quoted argument; a method that is a bare word stays bare, so the common case reads as before.Changelog
Fix the copied curl command breaking, or running extra commands, when a URL contains a quote.
Test Plan
swift test: 162 tests in 12 suites passed.survivesAShellfeeds the generated command to/bin/shwithcurlreplaced byprintf '%s\0'and checks the arguments the shell actually produced for a URL, method and header containing',;,$(…)and backticks; onmainthe shell splits the method and exits 127.writesPlainCommandpins the unchanged output for an ordinary GET.