Removed the use of Accept-Charset when using the HAPI client (#5961)
* Removed the use of Accept-Charset when using the HAPI client * Added changelog * Update 5962-remove-use-of-deprecated-accept-charset-header.yaml
This commit is contained in:
parent
93e101973e
commit
848fee05c7
|
@ -136,7 +136,6 @@ public class OkHttpRestfulClient implements IHttpClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
addUserAgentHeader(theHttpRequest, theContext);
|
addUserAgentHeader(theHttpRequest, theContext);
|
||||||
addAcceptCharsetHeader(theHttpRequest);
|
|
||||||
MethodUtil.addAcceptHeaderToRequest(theEncoding, theHttpRequest, theContext);
|
MethodUtil.addAcceptHeaderToRequest(theEncoding, theHttpRequest, theContext);
|
||||||
addIfNoneExistHeader(theHttpRequest);
|
addIfNoneExistHeader(theHttpRequest);
|
||||||
}
|
}
|
||||||
|
@ -145,10 +144,6 @@ public class OkHttpRestfulClient implements IHttpClient {
|
||||||
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "okhttp"));
|
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "okhttp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAcceptCharsetHeader(OkHttpRestfulRequest theHttpRequest) {
|
|
||||||
theHttpRequest.addHeader("Accept-Charset", "utf-8");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addIfNoneExistHeader(IHttpRequest result) {
|
private void addIfNoneExistHeader(IHttpRequest result) {
|
||||||
if (myIfNoneExistParams != null) {
|
if (myIfNoneExistParams != null) {
|
||||||
addIfNoneExistHeaderFromParams(result, myIfNoneExistParams);
|
addIfNoneExistHeaderFromParams(result, myIfNoneExistParams);
|
||||||
|
|
|
@ -81,7 +81,6 @@ public abstract class BaseHttpClient implements IHttpClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "apache"));
|
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "apache"));
|
||||||
theHttpRequest.addHeader("Accept-Charset", "utf-8");
|
|
||||||
theHttpRequest.addHeader("Accept-Encoding", "gzip");
|
theHttpRequest.addHeader("Accept-Encoding", "gzip");
|
||||||
|
|
||||||
addHeaderIfNoneExist(theHttpRequest);
|
addHeaderIfNoneExist(theHttpRequest);
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
type: fix
|
||||||
|
issue: 5962
|
||||||
|
title: "The default use of the Accept-Charset header has been removed as its use is deprecated. Thanks to Jens Villadsen for the suggestion and pull request!"
|
|
@ -119,7 +119,6 @@ public class JaxRsHttpClient implements IHttpClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "jax-rs"));
|
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "jax-rs"));
|
||||||
theHttpRequest.addHeader("Accept-Charset", "utf-8");
|
|
||||||
|
|
||||||
Builder request = theHttpRequest.getRequest();
|
Builder request = theHttpRequest.getRequest();
|
||||||
request.acceptEncoding("gzip");
|
request.acceptEncoding("gzip");
|
||||||
|
|
Loading…
Reference in New Issue