[GH-ISSUE #1763] POST data not properly escaped when exporting as cURL command #1756

Closed
opened 2026-03-03 19:54:04 +03:00 by kerem · 7 comments
Owner

Originally created by @seidnerj on GitHub (Sep 6, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1763

Originally assigned to: @NghiaTranUIT on GitHub.

Description

POST may not be properly escaped when exporting as cURL command.

Steps to Reproduce

Take a request with the post take containing an apostrophe, copy as cURL and try to run from the command line.

Current Behavior

If the post data of a request has an apostrophe in it, it is not escaped.

Expected Behavior

An apostrophe should be escaped as the post data is already enclosed in apostrophes.

Environment

  • App version: 4.10.0 (49100)
  • macOS version: Ventura 13.5.1
Originally created by @seidnerj on GitHub (Sep 6, 2023). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1763 Originally assigned to: @NghiaTranUIT on GitHub. ## Description POST may not be properly escaped when exporting as cURL command. ## Steps to Reproduce Take a request with the post take containing an apostrophe, copy as cURL and try to run from the command line. ## Current Behavior If the post data of a request has an apostrophe in it, it is not escaped. ## Expected Behavior An apostrophe should be escaped as the post data is already enclosed in apostrophes. ## Environment - App version: 4.10.0 (49100) - macOS version: Ventura 13.5.1
kerem 2026-03-03 19:54:04 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 7, 2023):

@seidnerj if you don't mind, can you provide an cURL example, so I can test it easily 🤔

<!-- gh-comment-id:1710085005 --> @NghiaTranUIT commented on GitHub (Sep 7, 2023): @seidnerj if you don't mind, can you provide an cURL example, so I can test it easily 🤔
Author
Owner

@seidnerj commented on GitHub (Sep 7, 2023):

Sure, you can use the example below.

This is a proper cURL command with apostrophe escaped:

curl 'https://libretranslate.com/translate' \
-X POST \
-H 'Host: libretranslate.com' \
-H 'User-Agent: curl/8.2.1' \
-H 'Accept: */*' \
-H 'Referer: https://libretranslate.com' \
-H 'Content-Length: 121' \
-H 'Content-Type: application/json' \
--data-raw '{"q": "ome sono mostrati nel'\''immagine.", "source": "auto", "target": "en", "format": "text", "api_key": "", "secret": ""}' \
--proxy http://localhost:9090

And the below is what you get when you copy as cURL from the Proxyman UI:

curl 'https://libretranslate.com/translate' \
-X POST \
-H 'Host: libretranslate.com' \
-H 'User-Agent: curl/8.2.1' \
-H 'Accept: */*' \
-H 'Referer: https://libretranslate.com' \
-H 'Content-Length: 121' \
-H 'Content-Type: application/json' \
--data-raw '{"q": "ome sono mostrati nel'immagine.", "source": "auto", "target": "en", "format": "text", "api_key": "", "secret": ""}' \
--proxy http://localhost:9090

See how nel'immagine appears instead of nel'\''immagine.

Thanks!

<!-- gh-comment-id:1710132558 --> @seidnerj commented on GitHub (Sep 7, 2023): Sure, you can use the example below. This is a proper cURL command with apostrophe escaped: ``` curl 'https://libretranslate.com/translate' \ -X POST \ -H 'Host: libretranslate.com' \ -H 'User-Agent: curl/8.2.1' \ -H 'Accept: */*' \ -H 'Referer: https://libretranslate.com' \ -H 'Content-Length: 121' \ -H 'Content-Type: application/json' \ --data-raw '{"q": "ome sono mostrati nel'\''immagine.", "source": "auto", "target": "en", "format": "text", "api_key": "", "secret": ""}' \ --proxy http://localhost:9090 ``` And the below is what you get when you copy as cURL from the Proxyman UI: ``` curl 'https://libretranslate.com/translate' \ -X POST \ -H 'Host: libretranslate.com' \ -H 'User-Agent: curl/8.2.1' \ -H 'Accept: */*' \ -H 'Referer: https://libretranslate.com' \ -H 'Content-Length: 121' \ -H 'Content-Type: application/json' \ --data-raw '{"q": "ome sono mostrati nel'immagine.", "source": "auto", "target": "en", "format": "text", "api_key": "", "secret": ""}' \ --proxy http://localhost:9090 ``` See how `nel'immagine` appears instead of `nel'\''immagine`. Thanks!
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 7, 2023):

Thanks for the detailed example. I'm going to fix it now 👍

<!-- gh-comment-id:1710146775 --> @NghiaTranUIT commented on GitHub (Sep 7, 2023): Thanks for the detailed example. I'm going to fix it now 👍
Author
Owner

@seidnerj commented on GitHub (Sep 7, 2023):

Awesome, thanks!

<!-- gh-comment-id:1710207713 --> @seidnerj commented on GitHub (Sep 7, 2023): Awesome, thanks!
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 7, 2023):

@seidnerj it's fixed. Here is the Beta build: https://download.proxyman.io/beta/Proxyman_4.10.0_fix_escape_string_in_curl.dmg


Thanks again for reporting the bug 👍

<!-- gh-comment-id:1710225751 --> @NghiaTranUIT commented on GitHub (Sep 7, 2023): @seidnerj it's fixed. Here is the Beta build: https://download.proxyman.io/beta/Proxyman_4.10.0_fix_escape_string_in_curl.dmg ---------- Thanks again for reporting the bug 👍
Author
Owner

@seidnerj commented on GitHub (Sep 7, 2023):

Thanks! I am already using another beta for the webkit ssl issue, does the above version include both fixes?

<!-- gh-comment-id:1710561527 --> @seidnerj commented on GitHub (Sep 7, 2023): Thanks! I am already using another beta for the webkit ssl issue, does the above version include both fixes?
Author
Owner

@NghiaTranUIT commented on GitHub (Sep 8, 2023):

Yes, it's included too @seidnerj

<!-- gh-comment-id:1710940329 --> @NghiaTranUIT commented on GitHub (Sep 8, 2023): Yes, it's included too @seidnerj
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1756
No description provided.