Render no-standard content-encoding response [INS-4910] #8341
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.