See gh-33716
@ -1136,7 +1136,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
set(HOST, value);
}
else {
remove(HOST, null);
remove(HOST);
@ -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);
void eTagWithoutQuotes() {
headers.setETag("v2.6");