Fix HttpHeaders.setHost() to remove the header
See gh-33716
This commit is contained in:
@@ -213,6 +213,15 @@ class HttpHeadersTests {
|
||||
assertThat(headers.getFirst("Host")).as("Invalid Host header").isEqualTo("[::1]");
|
||||
}
|
||||
|
||||
@Test
|
||||
void hostDeletion() {
|
||||
InetSocketAddress host = InetSocketAddress.createUnresolved("localhost", 8080);
|
||||
headers.setHost(host);
|
||||
headers.setHost(null);
|
||||
assertThat(headers.getHost()).as("Host is not deleted").isEqualTo(null);
|
||||
assertThat(headers.getFirst("Host")).as("Host is not deleted").isEqualTo(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
void eTagWithoutQuotes() {
|
||||
headers.setETag("v2.6");
|
||||
|
||||
Reference in New Issue
Block a user