Polishing contribution
See gh-24691
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2016 the original author or authors.
|
* Copyright 2002-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -42,13 +42,9 @@ public class CorsRegistry {
|
|||||||
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
|
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
|
||||||
* well as Ant-style path patterns (such as {@code "/admin/**"}).
|
* well as Ant-style path patterns (such as {@code "/admin/**"}).
|
||||||
*
|
*
|
||||||
* <p>The following defaults are applied to the {@link CorsRegistration}:
|
* <p>By default, the {@code CorsConfiguration} for this mapping is
|
||||||
* <ul>
|
* initialized with default values as described in
|
||||||
* <li>Allow all origins.</li>
|
* {@link CorsConfiguration#applyPermitDefaultValues()}.
|
||||||
* <li>Allow "simple" methods {@code GET}, {@code HEAD} and {@code POST}.</li>
|
|
||||||
* <li>Allow all headers.</li>
|
|
||||||
* <li>Set max age to 1800 seconds (30 minutes).</li>
|
|
||||||
* </ul>
|
|
||||||
*/
|
*/
|
||||||
public CorsRegistration addMapping(String pathPattern) {
|
public CorsRegistration addMapping(String pathPattern) {
|
||||||
CorsRegistration registration = new CorsRegistration(pathPattern);
|
CorsRegistration registration = new CorsRegistration(pathPattern);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2017 the original author or authors.
|
* Copyright 2002-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -42,16 +42,10 @@ public class CorsRegistry {
|
|||||||
*
|
*
|
||||||
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
|
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
|
||||||
* well as Ant-style path patterns (such as {@code "/admin/**"}).
|
* well as Ant-style path patterns (such as {@code "/admin/**"}).
|
||||||
* <p>By default, all origins, all headers and {@code GET}, {@code HEAD},
|
|
||||||
* and {@code POST} methods are allowed, and the max age is set to 30 minutes.
|
|
||||||
*
|
*
|
||||||
* <p>The following defaults are applied to the {@link CorsRegistration}:
|
* <p>By default, the {@code CorsConfiguration} for this mapping is
|
||||||
* <ul>
|
* initialized with default values as described in
|
||||||
* <li>Allow all origins.</li>
|
* {@link CorsConfiguration#applyPermitDefaultValues()}.
|
||||||
* <li>Allow "simple" methods {@code GET}, {@code HEAD} and {@code POST}.</li>
|
|
||||||
* <li>Allow all headers.</li>
|
|
||||||
* <li>Set max age to 1800 seconds (30 minutes).</li>
|
|
||||||
* </ul>
|
|
||||||
*/
|
*/
|
||||||
public CorsRegistration addMapping(String pathPattern) {
|
public CorsRegistration addMapping(String pathPattern) {
|
||||||
CorsRegistration registration = new CorsRegistration(pathPattern);
|
CorsRegistration registration = new CorsRegistration(pathPattern);
|
||||||
|
|||||||
Reference in New Issue
Block a user