diff --git a/providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/controller/GoFeatureFlagController.java b/providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/controller/GoFeatureFlagController.java index ab357d657..52a2813a2 100644 --- a/providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/controller/GoFeatureFlagController.java +++ b/providers/go-feature-flag/src/main/java/dev/openfeature/contrib/providers/gofeatureflag/controller/GoFeatureFlagController.java @@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit; import static dev.openfeature.sdk.Value.objectToValue; -import static org.apache.hc.core5.http.ContentType.APPLICATION_JSON; + /** * GoFeatureFlagController is the layer to contact the APIs and get the data @@ -54,6 +54,7 @@ @Slf4j @SuppressWarnings({"checkstyle:NoFinalizer"}) public class GoFeatureFlagController { + public static final String APPLICATION_JSON = "application/json"; public static final ObjectMapper requestMapper = new ObjectMapper(); private static final ObjectMapper responseMapper = new ObjectMapper() .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); @@ -136,7 +137,7 @@ public EvaluationResponse evaluateFlag( Request.Builder reqBuilder = new Request.Builder() .url(url) - .addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.getMimeType()) + .addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON) .post(RequestBody.create( requestMapper.writeValueAsBytes(goffRequest), MediaType.get("application/json; charset=utf-8"))); @@ -215,7 +216,7 @@ public void sendEventToDataCollector(List eventsList) { Request.Builder reqBuilder = new Request.Builder() .url(url) - .addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.getMimeType()) + .addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON) .post(RequestBody.create( requestMapper.writeValueAsBytes(events), MediaType.get("application/json; charset=utf-8"))); @@ -258,7 +259,7 @@ public ConfigurationChange configurationHasChanged() throws GoFeatureFlagExcepti Request.Builder reqBuilder = new Request.Builder() .url(url) - .addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.getMimeType()) + .addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON) .get(); if (this.etag != null && !this.etag.isEmpty()) {