|
19 | 19 | import java.security.Principal;
|
20 | 20 | import java.time.Instant;
|
21 | 21 | import java.time.temporal.ChronoUnit;
|
22 |
| -import java.util.Arrays; |
23 | 22 | import java.util.List;
|
24 | 23 | import java.util.Map;
|
| 24 | +import java.util.Set; |
25 | 25 | import java.util.concurrent.ConcurrentHashMap;
|
26 | 26 | import java.util.function.Function;
|
27 | 27 |
|
|
62 | 62 | */
|
63 | 63 | public class DefaultServerWebExchange implements ServerWebExchange {
|
64 | 64 |
|
65 |
| - private static final List<HttpMethod> SAFE_METHODS = Arrays.asList(HttpMethod.GET, HttpMethod.HEAD); |
| 65 | + private static final Set<HttpMethod> SAFE_METHODS = Set.of(HttpMethod.GET, HttpMethod.HEAD); |
66 | 66 |
|
67 | 67 | private static final ResolvableType FORM_DATA_TYPE =
|
68 | 68 | ResolvableType.forClassWithGenerics(MultiValueMap.class, String.class, String.class);
|
@@ -281,7 +281,7 @@ private boolean validateIfMatch(@Nullable String eTag) {
|
281 | 281 | if (SAFE_METHODS.contains(getRequest().getMethod())) {
|
282 | 282 | return false;
|
283 | 283 | }
|
284 |
| - if (CollectionUtils.isEmpty(getRequest().getHeaders().get(HttpHeaders.IF_MATCH))) { |
| 284 | + if (CollectionUtils.isEmpty(getRequestHeaders().get(HttpHeaders.IF_MATCH))) { |
285 | 285 | return false;
|
286 | 286 | }
|
287 | 287 | this.notModified = matchRequestedETags(getRequestHeaders().getIfMatch(), eTag, false);
|
@@ -357,7 +357,7 @@ private void updateResponseStateChanging(String eTag, Instant lastModified) {
|
357 | 357 |
|
358 | 358 | private boolean validateIfNoneMatch(@Nullable String eTag) {
|
359 | 359 | try {
|
360 |
| - if (CollectionUtils.isEmpty(getRequest().getHeaders().get(HttpHeaders.IF_NONE_MATCH))) { |
| 360 | + if (CollectionUtils.isEmpty(getRequestHeaders().get(HttpHeaders.IF_NONE_MATCH))) { |
361 | 361 | return false;
|
362 | 362 | }
|
363 | 363 | this.notModified = !matchRequestedETags(getRequestHeaders().getIfNoneMatch(), eTag, true);
|
|
0 commit comments