|
23 | 23 | import io.netty.resolver.NameResolver;
|
24 | 24 | import io.netty.util.concurrent.ImmediateEventExecutor;
|
25 | 25 | import org.asynchttpclient.channel.ChannelPoolPartitioning;
|
| 26 | +import org.asynchttpclient.cookie.CookieStore; |
26 | 27 | import org.asynchttpclient.proxy.ProxyServer;
|
27 | 28 | import org.asynchttpclient.request.body.generator.BodyGenerator;
|
28 | 29 | import org.asynchttpclient.request.body.generator.ReactiveStreamsBodyGenerator;
|
@@ -68,6 +69,7 @@ public abstract class RequestBuilderBase<T extends RequestBuilderBase<T>> {
|
68 | 69 | protected InetAddress localAddress;
|
69 | 70 | protected HttpHeaders headers;
|
70 | 71 | protected ArrayList<Cookie> cookies;
|
| 72 | + protected CookieStore cookieStore; |
71 | 73 | protected byte[] byteData;
|
72 | 74 | protected List<byte[]> compositeByteData;
|
73 | 75 | protected String stringData;
|
@@ -113,6 +115,7 @@ protected RequestBuilderBase(Request prototype, boolean disableUrlEncoding, bool
|
113 | 115 | if (isNonEmpty(prototype.getCookies())) {
|
114 | 116 | this.cookies = new ArrayList<>(prototype.getCookies());
|
115 | 117 | }
|
| 118 | + this.cookieStore = prototype.getCookieStore(); |
116 | 119 | this.byteData = prototype.getByteData();
|
117 | 120 | this.compositeByteData = prototype.getCompositeByteData();
|
118 | 121 | this.stringData = prototype.getStringData();
|
@@ -335,6 +338,11 @@ public void resetCookies() {
|
335 | 338 | if (this.cookies != null)
|
336 | 339 | this.cookies.clear();
|
337 | 340 | }
|
| 341 | + |
| 342 | + public T setCookieStore(CookieStore cookieStore) { |
| 343 | + this.cookieStore = cookieStore; |
| 344 | + return asDerivedType(); |
| 345 | + } |
338 | 346 |
|
339 | 347 | public void resetQuery() {
|
340 | 348 | queryParams = null;
|
@@ -580,6 +588,7 @@ private RequestBuilderBase<?> executeSignatureCalculator() {
|
580 | 588 | rb.charset = this.charset;
|
581 | 589 | rb.channelPoolPartitioning = this.channelPoolPartitioning;
|
582 | 590 | rb.nameResolver = this.nameResolver;
|
| 591 | + rb.cookieStore = this.cookieStore; |
583 | 592 | Request unsignedRequest = rb.build();
|
584 | 593 | signatureCalculator.calculateAndAddSignature(unsignedRequest, rb);
|
585 | 594 | return rb;
|
@@ -624,6 +633,7 @@ public Request build() {
|
624 | 633 | rb.localAddress,
|
625 | 634 | rb.headers,
|
626 | 635 | cookiesCopy,
|
| 636 | + rb.cookieStore, |
627 | 637 | rb.byteData,
|
628 | 638 | rb.compositeByteData,
|
629 | 639 | rb.stringData,
|
|
0 commit comments