Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: add new option for escaping brackets in curl snippets #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2021

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.

3 participants