mirror of
https://github.com/ProxymanApp/Proxyman.git
synced 2026-04-27 09:05:54 +03:00
[GH-ISSUE #1670] "Copy as" cURL omits "accept-encoding" header #1662
Labels
No labels
Discussion
Feature request
In Progress...
Plugins
Waiting response
Windows
Windows
bug
duplicate
enhancement
feature
good first issue
iOS
macOS 10.11
question
wontfix
✅ Done
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Proxyman#1662
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @seidnerj on GitHub (Jun 7, 2023).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1670
Originally assigned to: @NghiaTranUIT on GitHub.
Description
"Copy cURL" omits "accept-encoding" header
Steps to Reproduce
(test using HTTP v1.1)
Current Behavior
cURL command does not contain the "accept-encoding" header
Expected Behavior
cURL command should include all headers
Environment
@seidnerj commented on GitHub (Jun 7, 2023):
Also, potentially related issue (which might be related to some other issues I'm seeing): when running a cURL request through Proxyman to a URL that returns a gzip encoded response, the response is returned unencoded, but when not specifying Proxyman as a proxy server to cURL, you get binary output.
Here is an example. The next command returns unencoded output:
<!doctype html><html lang="en-us" class="a-no-js a-touch ....Whereas this (simply omitting the proxy), returns binary output:
I am using the following version of cURL:
@seidnerj commented on GitHub (Jun 7, 2023):
More info on the above, this is the difference between the request going through Proxyman and the one that does not.
Through Proxyman:
Without Proxyman:
As can bee seen, the request that does not go through Proxyman returns with "Content-Encoding: gzip". Unclear why would going through a proxy change the response by the server. Thoughts?
@NghiaTranUIT commented on GitHub (Jun 8, 2023):
It's our decision to remove these headers:
accept-encodingandcontent-encodingfrom the Request. The reason is: Many users would like to see the Response Body in plain text from their Terminal.If the cURL has these headers, the response body is:
which is hard to see the Content.
I guess, I would add an option into the Setting, so it doesn't omit any headers.
@seidnerj commented on GitHub (Jun 8, 2023):
The thing is, when you're trying to replicate behavior already seen by using cURL, you expect the same result. Not including this header can not only change the encoding by the server, but can also affect the actual content and/or flow that follows. It depends on what is the logic implemented by the server.
I highly recommended that by default this replicates the exact request.
Thank you for your consideration.
@NghiaTranUIT commented on GitHub (Jun 9, 2023):
Thanks @seidnerj I will put this flag in the next release 👍
@seidnerj commented on GitHub (Jun 9, 2023):
Many thanks!
@NghiaTranUIT commented on GitHub (Jun 10, 2023):
@seidnerj you can try this Beta build: https://download.proxyman.io/beta/Proxyman_4.8.0_Support_cURL_Encoding_Headers.dmg
You can disable it in the Setting -> Tool -> Remove Encoding Header. It's ON by default to avoid breaking the current behavior.
@seidnerj commented on GitHub (Jun 10, 2023):
You are awesome! Really appreciate the responsiveness with everything! This in part is what makes Proxyman a truly amazing product. Keep up the good work!
@seidnerj commented on GitHub (Jun 10, 2023):
I think it would be good to consider whether this setting should be something like "preserve original request" which will have an effect on all headers as well as other aspects that might be related.
Right now this option is very specific and there's already another option that changes the original request ("add content-length").
That's just my 2 cents.
@NghiaTranUIT commented on GitHub (Jun 11, 2023):
It's a really good suggestion @seidnerj. I'm going to refactor this way 👍
@NghiaTranUIT commented on GitHub (Jun 11, 2023):
I took your advice, and here is the new Beta: https://download.proxyman.io/beta/Proxyman_4.8.0_Use_new_option_for_cURL.dmg
Thanks again 👍
@seidnerj commented on GitHub (Jun 11, 2023):
That’s great! Many thanks 🚀