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

Render no-standard content-encoding response [INS-4910] #8341

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

yaoweiprc
Copy link
Contributor

@yaoweiprc yaoweiprc commented Feb 7, 2025

https://linear.app/insomnia/issue/INS-4910/support-custom-content-encoding
One of our customers reported that we couldn't render the response, the issue stems from the http response using the non-standard Content-Encoding header 'base64'. Currently, the libcurl library we use supports decompressing the response body with deflate, gzip, and br algorithms.

When the Content-Encoding response header uses a value other than deflate, gzip, or br, libcurl throws an error: "Unrecognized or bad HTTP Content or Transfer-Encoding", with error code 61.

At present, when libcurl throws the "Unrecognized or bad HTTP Content or Transfer-Encoding" error, we cannot retrieve the response body content.

To achieve the same behavior as Postman, we would first send a request. Upon encountering the "Unrecognized or bad HTTP Content or Transfer-Encoding" error, we would set ACCEPT_ENCODING in libcurl to null and resend the request. This way, libcurl will no longer throw the "Unrecognized or bad HTTP Content or Transfer-Encoding" error, and we can retrieve the compressed response body and Try to render it.

@yaoweiprc yaoweiprc marked this pull request as draft February 7, 2025 09:50
@yaoweiprc yaoweiprc changed the title Support no-standard content-encoding response Render no-standard content-encoding response [INS-4910] Feb 21, 2025
@yaoweiprc yaoweiprc force-pushed the feat/custom-content-encoding-response branch from e6975b3 to 6321a03 Compare February 21, 2025 02:46
@yaoweiprc yaoweiprc marked this pull request as ready for review February 21, 2025 02:48
@yaoweiprc yaoweiprc requested a review from a team February 21, 2025 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant