HttpHeaders#equals handles wrapping correctly

Closes gh-25034
This commit is contained in:
Rossen Stoyanchev
2020-05-08 09:37:37 +01:00
parent 4805288122
commit 19ba9087f5
3 changed files with 26 additions and 20 deletions

View File

@@ -703,4 +703,12 @@ public class HttpHeadersTests {
assertThat(readOnlyHttpHeaders.entrySet()).extracting(Entry::getKey).containsExactly(expectedKeys);
}
@Test // gh-25034
public void equalsUnwrapsHttpHeaders() {
HttpHeaders headers1 = new HttpHeaders();
HttpHeaders headers2 = new HttpHeaders(new HttpHeaders(headers1));
assertThat(headers1).isEqualTo(headers2);
assertThat(headers2).isEqualTo(headers1);
}
}