Skip to content

Commit

Permalink
Polishing contribution
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed Mar 13, 2020
1 parent c11dd4a commit 7b7dfca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,13 +42,9 @@ public class CorsRegistry {
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
* well as Ant-style path patterns (such as {@code "/admin/**"}).
*
* <p>The following defaults are applied to the {@link CorsRegistration}:
* <ul>
* <li>Allow all origins.</li>
* <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>
* <p>By default, the {@code CorsConfiguration} for this mapping is
* initialized with default values as described in
* {@link CorsConfiguration#applyPermitDefaultValues()}.
*/
public CorsRegistration addMapping(String pathPattern) {
CorsRegistration registration = new CorsRegistration(pathPattern);
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,16 +42,10 @@ public class CorsRegistry {
*
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
* 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}:
* <ul>
* <li>Allow all origins.</li>
* <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>
* <p>By default, the {@code CorsConfiguration} for this mapping is
* initialized with default values as described in
* {@link CorsConfiguration#applyPermitDefaultValues()}.
*/
public CorsRegistration addMapping(String pathPattern) {
CorsRegistration registration = new CorsRegistration(pathPattern);
Expand Down

0 comments on commit 7b7dfca

Please sign in to comment.