|
17 | 17 |
|
18 | 18 | package org.openqa.selenium.remote.http;
|
19 | 19 |
|
20 |
| -import static com.google.common.net.HttpHeaders.CONTENT_TYPE; |
21 |
| -import static java.nio.charset.StandardCharsets.UTF_8; |
22 |
| -import static org.openqa.selenium.remote.http.Contents.bytes; |
23 |
| -import static org.openqa.selenium.remote.http.Contents.reader; |
24 |
| -import static org.openqa.selenium.remote.http.Contents.string; |
25 |
| - |
26 | 20 | import com.google.common.collect.ArrayListMultimap;
|
27 | 21 | import com.google.common.collect.ImmutableSet;
|
28 | 22 | import com.google.common.collect.Multimap;
|
|
40 | 34 | import java.util.function.Supplier;
|
41 | 35 | import java.util.stream.Collectors;
|
42 | 36 |
|
| 37 | +import static com.google.common.net.HttpHeaders.CONTENT_TYPE; |
| 38 | +import static java.nio.charset.StandardCharsets.UTF_8; |
| 39 | +import static org.openqa.selenium.remote.http.Contents.bytes; |
| 40 | +import static org.openqa.selenium.remote.http.Contents.reader; |
| 41 | +import static org.openqa.selenium.remote.http.Contents.string; |
| 42 | + |
43 | 43 | abstract class HttpMessage<M extends HttpMessage<M>> {
|
44 | 44 |
|
45 | 45 | private final Multimap<String, String> headers = ArrayListMultimap.create();
|
@@ -106,7 +106,10 @@ public M addHeader(String name, String value) {
|
106 | 106 | }
|
107 | 107 |
|
108 | 108 | public M removeHeader(String name) {
|
109 |
| - headers.removeAll(name); |
| 109 | + String toRemove = headers.keySet().stream() |
| 110 | + .filter(header -> header.equalsIgnoreCase(name)) |
| 111 | + .findFirst().orElse(name); |
| 112 | + headers.removeAll(toRemove); |
110 | 113 | return self();
|
111 | 114 | }
|
112 | 115 |
|
|
0 commit comments