Skip to content

Commit 2232307

Browse files
committed
Polishing
1 parent a34b1af commit 2232307

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

spring-web/src/main/java/org/springframework/web/cors/DefaultCorsProcessor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,9 +41,9 @@
4141
* The default implementation of {@link CorsProcessor}, as defined by the
4242
* <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>.
4343
*
44-
* <p>Note that when input {@link CorsConfiguration} is {@code null}, this
44+
* <p>Note that when the supplied {@link CorsConfiguration} is {@code null}, this
4545
* implementation does not reject simple or actual requests outright but simply
46-
* avoid adding CORS headers to the response. CORS processing is also skipped
46+
* avoids adding CORS headers to the response. CORS processing is also skipped
4747
* if the response already contains CORS headers.
4848
*
4949
* @author Sebastien Deleuze

spring-web/src/main/java/org/springframework/web/cors/reactive/DefaultCorsProcessor.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
1717
package org.springframework.web.cors.reactive;
1818

1919
import java.util.ArrayList;
20-
import java.util.Arrays;
2120
import java.util.List;
2221

2322
import org.apache.commons.logging.Log;
@@ -37,9 +36,9 @@
3736
* The default implementation of {@link CorsProcessor},
3837
* as defined by the <a href="https://www.w3.org/TR/cors/">CORS W3C recommendation</a>.
3938
*
40-
* <p>Note that when input {@link CorsConfiguration} is {@code null}, this
39+
* <p>Note that when the supplied {@link CorsConfiguration} is {@code null}, this
4140
* implementation does not reject simple or actual requests outright but simply
42-
* avoid adding CORS headers to the response. CORS processing is also skipped
41+
* avoids adding CORS headers to the response. CORS processing is also skipped
4342
* if the response already contains CORS headers.
4443
*
4544
* @author Sebastien Deleuze
@@ -50,13 +49,12 @@ public class DefaultCorsProcessor implements CorsProcessor {
5049

5150
private static final Log logger = LogFactory.getLog(DefaultCorsProcessor.class);
5251

53-
private static final List<String> VARY_HEADERS = Arrays.asList(
52+
private static final List<String> VARY_HEADERS = List.of(
5453
HttpHeaders.ORIGIN, HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS);
5554

5655

5756
@Override
5857
public boolean process(@Nullable CorsConfiguration config, ServerWebExchange exchange) {
59-
6058
ServerHttpRequest request = exchange.getRequest();
6159
ServerHttpResponse response = exchange.getResponse();
6260
HttpHeaders responseHeaders = response.getHeaders();

0 commit comments

Comments
 (0)