Skip to content
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

🐛 properly escape single quote in cURL interceptor output #635

Merged

Conversation

techouse
Copy link
Collaborator

@techouse techouse commented Sep 1, 2024

I noticed that a single quote ' is not properly escaped in the cURL output so I escaped it according to this.

For example

final fakeRequest = Request(
  'POST',
  Uri.parse('/'),
  Uri.parse('base'),
  body: r"""Lorem's ipsum "dolor" sit amet""",
);

should generate this cURL output

curl -v -X POST -H 'content-type: text/plain; charset=utf-8' -d 'Lorem'\''s ipsum "dolor" sit amet' 'base/'

and not fail when you paste it into your shell or Postman.

@techouse techouse added the bug Something isn't working label Sep 1, 2024
Copy link

codecov bot commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.38%. Comparing base (7a1f7c2) to head (04daf80).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #635   +/-   ##
========================================
  Coverage    93.38%   93.38%           
========================================
  Files           21       21           
  Lines          499      499           
========================================
  Hits           466      466           
  Misses          33       33           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@techouse techouse assigned techouse and JEuler and unassigned techouse Sep 1, 2024
@techouse techouse marked this pull request as ready for review September 3, 2024 09:17
@techouse techouse merged commit b7ebf67 into develop Sep 4, 2024
6 checks passed
@techouse techouse deleted the fix/chopper/curl-interceptor-escape-single-quotes branch September 4, 2024 14:24
techouse added a commit that referenced this pull request Sep 5, 2024
# chopper

- #635

# chopper_generator

- #634
@techouse techouse mentioned this pull request Sep 5, 2024
techouse added a commit that referenced this pull request Sep 5, 2024
- 🐛 properly escape single quote in cURL interceptor output #635
- 🎨 remove duplicate null-coalescing responseTypeReference #634
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.

2 participants