Skip to content

Conversation

@erunion
Copy link
Member

@erunion erunion commented May 25, 2021

This fixes a case where because we pass escapeQueryStrings: false to HTTPSnippet and don't escape query strings (instead relying on OAS style configurations), query strings in cURL snippets like [["$attributed_flow","=","FLOW_ID"]] wouldn't be escaped if the OAS doesn't use styles, resulting in a cURL snippet that couldn't actually be run.

$ curl --request GET \
>   --url 'https://mockbin.org/?where=[["$attributed_flow","=","FLOW_ID"]]' \
>   --header 'Accept: application/json'
curl: (3) [globbing] bad range specification in column 29

This fixes this problem by adding a new option to the cURL target called escapeBrackets that when present will manually escape [ and ]in the fullUrl data that it uses to chuck into the --url argument.

Resolves CX-347

@erunion erunion added the bug Something isn't working label May 25, 2021
@erunion erunion requested review from Dashron and rahulhegdee May 25, 2021 21:32
@erunion erunion merged commit 815cad3 into master Jun 1, 2021
@erunion erunion deleted the fix/curl-escaping branch June 1, 2021 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants