Skip to content

Commit

Permalink
add Expect100ContinueFeature
Browse files Browse the repository at this point in the history
  • Loading branch information
dunedodo committed Nov 29, 2023
1 parent 0c85d41 commit f2c01b0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.glassfish.jersey.apache.connector.ApacheClientProperties;
import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
import org.glassfish.jersey.client.*;
import org.glassfish.jersey.client.http.Expect100ContinueFeature;
import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import org.glassfish.jersey.message.internal.ByteArrayProvider;
import org.glassfish.jersey.message.internal.FileProvider;
Expand Down Expand Up @@ -108,6 +109,10 @@ public static JerseyClient createStandardClient(SmartConfig smartConfig,
client = createApacheClient(smartConfig);
else if (clientTransportConnector.equals(HTTPURLCONNECTION_TRANSPORT_CONNECTOR)) {
client = JerseyClientBuilder.createClient();
System.setProperty("sun.net.http.allowRestrictedHeaders", "true");
// Since Jersey 2.32 it is possible to send Expect:100-continue header from Jersey client
// DEFAULT_EXPECT_100_CONTINUE_THRESHOLD_SIZE = 65536L
client.register(Expect100ContinueFeature.basic());
}

// pass in jersey parameters from calling code (allows customization of client)
Expand Down

0 comments on commit f2c01b0

Please sign in to comment.