Repository navigation
Description
We recently updated the HTTP request plugin to version 1.24 and are seeing issues in one workflow where a vendor API returns the response header Content-Encoding: none.
This results in the plugin throwing the following exception:
org.apache.hc.core5.http.HttpException: Unsupported Content-Encoding: none at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:153) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:110) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:185) Caused: org.apache.hc.client5.http.ClientProtocolException: Unsupported Content-Encoding: none at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:188) at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87) at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.apache.hc.client5.http.classic.HttpClient.executeOpen(HttpClient.java:183) at jenkins.plugins.http_request.util.HttpClientUtil.execute(HttpClientUtil.java:122) at jenkins.plugins.http_request.HttpRequestExecution.executeRequest(HttpRequestExecution.java:484) at jenkins.plugins.http_request.HttpRequestExecution.authAndRequest(HttpRequestExecution.java:385) at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:293)
I'm guessing this was due to the migration to httpclient 5 in version 1.21.
The plugin appears to have gracefully handled (ignored) the API request in the previous version.
Is there a way to configure the plugin to ignore this type of response? Thank you! m
Originally reported by l3ender, imported from: Request fails if response contains header Content-Encoding: none
- assignee:
janario
- status: Open
- priority: Minor
- component(s): http-request-plugin
- resolution: Unresolved
- votes: 0
- watchers: 3
- imported: 20260702-081740
Raw content of original issue
We recently updated the HTTP request plugin to version 1.24 and are seeing issues in one workflow where a vendor API returns the response header Content-Encoding: none.
This results in the plugin throwing the following exception:
org.apache.hc.core5.http.HttpException: Unsupported Content-Encoding: none at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:153) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:110) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:185) Caused: org.apache.hc.client5.http.ClientProtocolException: Unsupported Content-Encoding: none at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:188) at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:87) at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.apache.hc.client5.http.classic.HttpClient.executeOpen(HttpClient.java:183) at jenkins.plugins.http_request.util.HttpClientUtil.execute(HttpClientUtil.java:122) at jenkins.plugins.http_request.HttpRequestExecution.executeRequest(HttpRequestExecution.java:484) at jenkins.plugins.http_request.HttpRequestExecution.authAndRequest(HttpRequestExecution.java:385) at jenkins.plugins.http_request.HttpRequestExecution.call(HttpRequestExecution.java:293)I'm guessing this was due to the migration to httpclient 5 in version 1.21.
The plugin appears to have gracefully handled (ignored) the API request in the previous version.
Is there a way to configure the plugin to ignore this type of response? Thank you! m
Activity
jenkins-infra-bot commentedon Jan 13, 2026
Raw content of original comment:
strangelookingnerd any chance you could look at this one?
jenkins-infra-bot commentedon Jan 19, 2026
Raw content of original comment:
Hey l3ender,
I took a look at the httpclient implementation and could not really see a change in behavior compared to 4.5.x. From what I can tell "unknown" values for Content-Encoding should be ignored in both versions by default.
I also tried to reproduce the issue but am unable to do so. I suspect that there might be other headers in the response that trip the logic.
Would you be able to give me more details on the request and also the response? I don't mind the contents being redacted if needed, but I require a reproducer to find the root cause.
jenkins-infra-bot commentedon Jan 23, 2026
l3ender:
Raw content of original comment:
Sorry for the delay, strangelookingnerd.
The request is to a vendor API to download a file. Here's a curl command for the API in question--hope that helps!
jenkins-infra-bot commentedon Jan 23, 2026
l3ender:
Raw content of original comment:
If it's helpful, here's our usage of the jenkins plugin in our pipeline:
httpRequest( url: "https://yjz43250.live.dynatrace.com/api/v1/deployment/installer/agent/unix/paas-sh/latest?flavor=${flavor}${includeQueryString}", customHeaders: [[name: 'Authorization', value: 'Api-Token ' + env.DT_API_TOKEN, maskValue: true]], outputFile: filepath, )jenkins-infra-bot commentedon Jan 23, 2026
Raw content of original comment:
I created a reproducer in #232
Unfortunately I'm unable to reproduce the error you are seeing. Also looking at the code in httpclient5 does not really give me any ideas how this exception can be thrown as the default behavior is to ignore unknown values for Content-Encoding. See https://github.com/apache/httpcomponents-client/blob/5.5.x/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ContentCompressionExec.java#L173-L196
Not sure how to continue here
jenkins-infra-bot commentedon Jan 27, 2026
l3ender:
Raw content of original comment:
I see the version of Apache HttpComponents Client 5.x API that is installed in our Jenkins is 5.6-183.ve5a_8a_b_e71e59. This is using version 5.6 of org.apache.httpcomponents.client5:httpclient5.
Based on that, I see different code in ContentCompressionExec than what you linked for version 5.5 - https://github.com/apache/httpcomponents-client/blob/rel/v5.6/httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ContentCompressionExec.java#L143-L156.
Please let me know if that helps or if I can provide any other info from our environment--thanks!
jenkins-infra-bot commentedon Feb 4, 2026
Raw content of original comment:
You are absolutely right, thanks for double checking!
This change in behavior was introduced in apache/httpcomponents-client#698 and was shipped in the latest 5.6 release. While I don’t agree with the reasoning in there, it’s not my decision to make either. Further I do not think that there is much we can do in the plugin as of now. The workaround mentioned in the PR could be implemented in the plugin, I would need to look into that. Other than that you could try alternatives to the plugin, such as curl or wget.