Fixes #7994 - Ability to construct a detached client Request (#8103)

Implemented copy of the request tag that was mistakenly missing.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2022-06-03 09:27:10 +02:00 committed by GitHub
parent 944ce6354f
commit e9262ce26c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -448,7 +448,8 @@ public class HttpClient extends ContainerLifeCycle
.body(oldRequest.getBody())
.idleTimeout(oldRequest.getIdleTimeout(), TimeUnit.MILLISECONDS)
.timeout(oldRequest.getTimeout(), TimeUnit.MILLISECONDS)
.followRedirects(oldRequest.isFollowRedirects());
.followRedirects(oldRequest.isFollowRedirects())
.tag(oldRequest.getTag());
for (HttpField field : oldRequest.getHeaders())
{
HttpHeader header = field.getHeader();

View File

@ -1618,6 +1618,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
.timeout(123231, TimeUnit.SECONDS)
.idleTimeout(232342, TimeUnit.SECONDS)
.followRedirects(false)
.tag("tag")
.headers(headers -> headers.put(HttpHeader.ACCEPT, "application/json"))
.headers(headers -> headers.put("X-Some-Other-Custom-Header", "some-other-value")));
@ -1969,6 +1970,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
assertEquals(original.getIdleTimeout(), copy.getIdleTimeout());
assertEquals(original.getTimeout(), copy.getTimeout());
assertEquals(original.isFollowRedirects(), copy.isFollowRedirects());
assertEquals(original.getTag(), copy.getTag());
assertEquals(original.getHeaders(), copy.getHeaders());
}