Skip to content

Commit 7b7dfca

Browse files
committed
Polishing contribution
See spring-projectsgh-24691
1 parent c11dd4a commit 7b7dfca

2 files changed

Lines changed: 8 additions & 18 deletions

File tree

  • spring-webflux/src/main/java/org/springframework/web/reactive/config
  • spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation

‎spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistry.java‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -42,13 +42,9 @@ public class CorsRegistry {
4242
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
4343
* well as Ant-style path patterns (such as {@code "/admin/**"}).
4444
*
45-
* <p>The following defaults are applied to the {@link CorsRegistration}:
46-
* <ul>
47-
* <li>Allow all origins.</li>
48-
* <li>Allow "simple" methods {@code GET}, {@code HEAD} and {@code POST}.</li>
49-
* <li>Allow all headers.</li>
50-
* <li>Set max age to 1800 seconds (30 minutes).</li>
51-
* </ul>
45+
* <p>By default, the {@code CorsConfiguration} for this mapping is
46+
* initialized with default values as described in
47+
* {@link CorsConfiguration#applyPermitDefaultValues()}.
5248
*/
5349
public CorsRegistration addMapping(String pathPattern) {
5450
CorsRegistration registration = new CorsRegistration(pathPattern);

‎spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistry.java‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -42,16 +42,10 @@ public class CorsRegistry {
4242
*
4343
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
4444
* well as Ant-style path patterns (such as {@code "/admin/**"}).
45-
* <p>By default, all origins, all headers and {@code GET}, {@code HEAD},
46-
* and {@code POST} methods are allowed, and the max age is set to 30 minutes.
4745
*
48-
* <p>The following defaults are applied to the {@link CorsRegistration}:
49-
* <ul>
50-
* <li>Allow all origins.</li>
51-
* <li>Allow "simple" methods {@code GET}, {@code HEAD} and {@code POST}.</li>
52-
* <li>Allow all headers.</li>
53-
* <li>Set max age to 1800 seconds (30 minutes).</li>
54-
* </ul>
46+
* <p>By default, the {@code CorsConfiguration} for this mapping is
47+
* initialized with default values as described in
48+
* {@link CorsConfiguration#applyPermitDefaultValues()}.
5549
*/
5650
public CorsRegistration addMapping(String pathPattern) {
5751
CorsRegistration registration = new CorsRegistration(pathPattern);

0 commit comments

Comments
 (0)