Skip to content

Commit

Permalink
Removed the use of Accept-Charset when using the HAPI client (#5961)
Browse files Browse the repository at this point in the history
* Removed the use of Accept-Charset when using the HAPI client

* Added changelog

* Update 5962-remove-use-of-deprecated-accept-charset-header.yaml
  • Loading branch information
jkiddo committed May 24, 2024
1 parent 93e1019 commit 848fee0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ private void addHeadersToRequest(
}

addUserAgentHeader(theHttpRequest, theContext);
addAcceptCharsetHeader(theHttpRequest);
MethodUtil.addAcceptHeaderToRequest(theEncoding, theHttpRequest, theContext);
addIfNoneExistHeader(theHttpRequest);
}
Expand All @@ -145,10 +144,6 @@ private void addUserAgentHeader(OkHttpRestfulRequest theHttpRequest, FhirContext
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "okhttp"));
}

private void addAcceptCharsetHeader(OkHttpRestfulRequest theHttpRequest) {
theHttpRequest.addHeader("Accept-Charset", "utf-8");
}

private void addIfNoneExistHeader(IHttpRequest result) {
if (myIfNoneExistParams != null) {
addIfNoneExistHeaderFromParams(result, myIfNoneExistParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public void addHeadersToRequest(IHttpRequest theHttpRequest, EncodingEnum theEnc
}

theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "apache"));
theHttpRequest.addHeader("Accept-Charset", "utf-8");
theHttpRequest.addHeader("Accept-Encoding", "gzip");

addHeaderIfNoneExist(theHttpRequest);
Expand Down
Original file line number Diff line number Diff line change
@@ -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!"
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public void addHeadersToRequest(JaxRsHttpRequest theHttpRequest, EncodingEnum th
}

theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "jax-rs"));
theHttpRequest.addHeader("Accept-Charset", "utf-8");

Builder request = theHttpRequest.getRequest();
request.acceptEncoding("gzip");
Expand Down

0 comments on commit 848fee0

Please sign in to comment.