jenkinsci / jenkinsci/http-request-plugin
[JENKINS-76353] Request fails if response contains header Content-Encoding: none
- Dominant language
- Java
- Stars
- 176
- Forks
- 158
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 3
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
janario
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
Contributor guide
Assessment
This issue has not been assessed yet.