Quote curl URLs in docs to prevent shell globbing#6561
Conversation
Unquoted URLs with query strings (e.g. `?format=json`) fail in zsh because `?` triggers glob expansion before curl runs. Wrap every curl URL in single quotes across documentation examples so commands work when copied verbatim. Fixes feldera#6560
mythical-fred
left a comment
There was a problem hiding this comment.
Nice cleanup overall — zsh globbing on ? is a real papercut and quoting the URLs is the right fix.
One issue: two of the URLs contain \& (backslash-escaped &), which was only there to protect the ampersand from the unquoted shell. Once the whole URL is wrapped in single quotes, the backslash is no longer a shell escape and ends up as a literal \ inside the URL — so the request goes out with & properly delimited but the preceding character is \, which breaks the query string. Inline comments on the two spots.
The raw.md case is fine because it uses a bare &, which is what you want inside single quotes.
Two unrelated nits while we're here:
- A handful of files gained a single trailing blank line (e.g.
connectors/completion-tokens.md,sinks/http.md,sources/http-get.md,sources/http.md,formats/raw.md,get-started/docker.md,get-started/enterprise/https.md). Worth dropping — keeps the diff to just the substantive change. - The PR doesn't touch
connectors/sources/http.md'sBearer <API-KEY>example content, but please double-check there aren't other curl examples in the repo that still need this treatment —rg "curl .* http.*\?" docs.feldera.comis a quick way to spot stragglers.
Fix the \& regressions and I'll approve.
| ```bash | ||
| curl -i -X 'POST' \ | ||
| http://127.0.0.1:8080/v0/pipelines/supply-chain-pipeline/egress/average_price?format=json\&send_snapshot=true | ||
| 'http://127.0.0.1:8080/v0/pipelines/supply-chain-pipeline/egress/average_price?format=json\&send_snapshot=true' |
There was a problem hiding this comment.
Regression: this URL contains \&. Outside single quotes, the backslash was protecting & from the shell. Inside single quotes the backslash is no longer interpreted by the shell and is passed verbatim to curl, producing a request to ...?format=json\&send_snapshot=true — that's a literal backslash in the query string, not a parameter separator, and the server will not parse send_snapshot correctly.
Drop the backslash:
curl -i -X 'POST' \
'http://127.0.0.1:8080/v0/pipelines/supply-chain-pipeline/egress/average_price?format=json&send_snapshot=true'| ```bash | ||
| curl -i -X 'POST' \ | ||
| http://127.0.0.1:8080/v0/pipelines/supply-chain-pipeline/ingress/product?format=json\&array=true \ | ||
| 'http://127.0.0.1:8080/v0/pipelines/supply-chain-pipeline/ingress/product?format=json\&array=true' \ |
There was a problem hiding this comment.
Same issue as in sinks/http.md: \& inside single quotes is a literal backslash followed by &, not an escaped ampersand. The URL needs a plain & now that the whole thing is single-quoted:
curl -i -X 'POST' \
'http://127.0.0.1:8080/v0/pipelines/supply-chain-pipeline/ingress/product?format=json&array=true' \
-d '[{"insert": {"pid": 0, "name": "hammer", "price": 5}}, {"insert": {"pid": 1, "name": "nail", "price": 0.02}}]'Revert accidental EOF newlines introduced when quoting curl URLs. No content changes.
Inside single quotes, `\&` is sent literally to the server. Use plain `&` for query-string separators now that URLs are quoted.
|
@mihaibudiu I have fixed the comments
|
Unquoted URLs with query strings (e.g.
?format=json) fail in zsh because?triggers glob expansion before curl runs. Wrap every curl URL in single quotes across documentation examples so commands work when copied verbatim.Fixes #6560
Checklist
Breaking Changes?
Mark if you think the answer is yes for any of these components: