Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
erunion merged 1 commit intomasterreadmeio/httpsnippet:masterfrom
fix/curl-escapingreadmeio/httpsnippet:fix/curl-escapingCopy head branch name to clipboard
Jun 1, 2021
Merged

fix: add new option for escaping brackets in curl snippets#45
erunion merged 1 commit intomasterreadmeio/httpsnippet:masterfrom
fix/curl-escapingreadmeio/httpsnippet:fix/curl-escapingCopy head branch name to clipboard

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.