@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2024 the original author or authors .
* Copyright 2002 - 2025 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -41,6 +41,7 @@ import okhttp3.mockwebserver.RecordedRequest;
@@ -41,6 +41,7 @@ import okhttp3.mockwebserver.RecordedRequest;
import okio.Buffer ;
import org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder ;
import org.junit.jupiter.api.AfterEach ;
import org.junit.jupiter.api.Assumptions ;
import org.junit.jupiter.api.BeforeEach ;
import org.junit.jupiter.api.Named ;
import org.junit.jupiter.api.Test ;
@ -201,6 +202,25 @@ class ClientHttpConnectorTests {
@@ -201,6 +202,25 @@ class ClientHttpConnectorTests {
. verifyComplete ( ) ;
}
@ParameterizedConnectorTest
void partitionedCookieSupport ( ClientHttpConnector connector ) {
Assumptions . assumeFalse ( connector instanceof JettyClientHttpConnector , "Jetty client does not support partitioned cookies" ) ;
Assumptions . assumeFalse ( connector instanceof JdkClientHttpConnector , "JDK client does not support partitioned cookies" ) ;
prepareResponse ( response - > {
response . setResponseCode ( 200 ) ;
response . addHeader ( "Set-Cookie" , "id=test; Partitioned;" ) ;
} ) ;
Mono < ClientHttpResponse > futureResponse =
connector . connect ( HttpMethod . GET , this . server . url ( "/" ) . uri ( ) , ReactiveHttpOutputMessage : : setComplete ) ;
StepVerifier . create ( futureResponse )
. assertNext ( response - > {
assertThat ( response . getStatusCode ( ) ) . isEqualTo ( HttpStatus . OK ) ;
assertThat ( response . getCookies ( ) . getFirst ( "id" ) . isPartitioned ( ) ) . isTrue ( ) ;
}
)
. verifyComplete ( ) ;
}
@Test
void disableCookieWithHttpComponents ( ) {
ClientHttpConnector connector = new HttpComponentsClientHttpConnector (