Upgrade okhttp_version to 4.9.3. (#3683)

* Upgrade okhttp_version to 4.9.3.

Remove dependency on okhttp.internal package.

Fixes https://github.com/hapifhir/hapi-fhir/issues/3682

* Include "okhttp/" before the okhttp version in the user agent.

Fixup GenericClientDstu3IT test expectation for the new okhttp version.

Fixes https://github.com/hapifhir/hapi-fhir/pull/3683#issuecomment-1151492939

* Remove the okhttp version from the user-agent.

For consistency with the apache-based client, also simplifies upgrade (tests won't fail).

Fixes https://github.com/hapifhir/hapi-fhir/pull/3683#issuecomment-1151589776
This commit is contained in:
Martin Ashby 2022-06-14 14:59:02 +01:00 committed by GitHub
parent 1eeb6112f6
commit e2effc65b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -81,7 +81,7 @@ public class GenericClientDstu3IT {
}
private String expectedUserAgent() {
return "HAPI-FHIR/" + VersionUtil.getVersion() + " (FHIR Client; FHIR " + FhirVersionEnum.DSTU3.getFhirVersionString() + "/DSTU3; okhttp/3.8.1)";
return "HAPI-FHIR/" + VersionUtil.getVersion() + " (FHIR Client; FHIR " + FhirVersionEnum.DSTU3.getFhirVersionString() + "/DSTU3; okhttp)";
}

View File

@ -32,7 +32,6 @@ import ca.uhn.fhir.rest.client.api.*;
import ca.uhn.fhir.rest.client.impl.BaseHttpClientInvocation;
import ca.uhn.fhir.rest.client.method.MethodUtil;
import okhttp3.*;
import okhttp3.internal.Version;
/**
* A Http Request based on OkHttp. This is an adapter around the class
@ -127,7 +126,7 @@ public class OkHttpRestfulClient implements IHttpClient {
}
private void addUserAgentHeader(OkHttpRestfulRequest theHttpRequest, FhirContext theContext) {
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, Version.userAgent()));
theHttpRequest.addHeader("User-Agent", HttpClientUtil.createUserAgentString(theContext, "okhttp"));
}
private void addAcceptCharsetHeader(OkHttpRestfulRequest theHttpRequest) {

View File

@ -814,7 +814,7 @@
<jackson_databind_version>2.13.2.2</jackson_databind_version>
<maven_assembly_plugin_version>3.3.0</maven_assembly_plugin_version>
<maven_license_plugin_version>1.8</maven_license_plugin_version>
<okhttp_version>3.8.1</okhttp_version>
<okhttp_version>4.9.3</okhttp_version>
<poi_version>4.1.2</poi_version>
<poi_ooxml_schemas_version>1.4</poi_ooxml_schemas_version>
<resteasy_version>5.0.2.Final</resteasy_version>