Skip to content

Commit

Permalink
Fixes #7994 - Ability to construct a detached client Request
Browse files Browse the repository at this point in the history
Implemented copy of the request tag that was mistakenly missing.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Jun 2, 2022
1 parent d12ee70 commit e7b6d26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -448,7 +448,8 @@ protected Request copyRequest(HttpRequest oldRequest, URI newURI)
.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();
Expand Down
Expand Up @@ -1618,6 +1618,7 @@ public void testCopyRequest(Scenario scenario) throws Exception
.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")));

Expand Down Expand Up @@ -1969,6 +1970,7 @@ private void assertCopyRequest(Request original)
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());
}

Expand Down

0 comments on commit e7b6d26

Please sign in to comment.