Browse Source

Declare allowPrivateNetwork as available since 5.3.32

See gh-28546
See gh-31974
pull/32145/head
Juergen Hoeller 2 years ago
parent
commit
9bd2be80b9
  1. 4
      spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
  2. 8
      spring-web/src/main/java/org/springframework/web/cors/CorsConfiguration.java
  3. 4
      spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java
  4. 4
      spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java

4
spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 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.
@ -120,7 +120,7 @@ public @interface CrossOrigin {
* Whether private network access is supported. Please, see * Whether private network access is supported. Please, see
* {@link CorsConfiguration#setAllowPrivateNetwork(Boolean)} for details. * {@link CorsConfiguration#setAllowPrivateNetwork(Boolean)} for details.
* <p>By default this is not set (i.e. private network access is not supported). * <p>By default this is not set (i.e. private network access is not supported).
* @since 6.1.3 * @since 5.3.32
*/ */
String allowPrivateNetwork() default ""; String allowPrivateNetwork() default "";

8
spring-web/src/main/java/org/springframework/web/cors/CorsConfiguration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 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.
@ -478,7 +478,7 @@ public class CorsConfiguration {
* origins} and {@link #setAllowedOriginPatterns(List) originPatterns} are processed, * origins} and {@link #setAllowedOriginPatterns(List) originPatterns} are processed,
* see related API documentation for more details. * see related API documentation for more details.
* <p>By default this is not set (i.e. private network access is not supported). * <p>By default this is not set (i.e. private network access is not supported).
* @since 6.1.3 * @since 5.3.32
* @see <a href="https://wicg.github.io/private-network-access/">Private network access specifications</a> * @see <a href="https://wicg.github.io/private-network-access/">Private network access specifications</a>
*/ */
public void setAllowPrivateNetwork(@Nullable Boolean allowPrivateNetwork) { public void setAllowPrivateNetwork(@Nullable Boolean allowPrivateNetwork) {
@ -487,7 +487,7 @@ public class CorsConfiguration {
/** /**
* Return the configured {@code allowPrivateNetwork} flag, or {@code null} if none. * Return the configured {@code allowPrivateNetwork} flag, or {@code null} if none.
* @since 6.1.3 * @since 5.3.32
* @see #setAllowPrivateNetwork(Boolean) * @see #setAllowPrivateNetwork(Boolean)
*/ */
@Nullable @Nullable
@ -582,7 +582,7 @@ public class CorsConfiguration {
* {@link #setAllowedOrigins allowedOrigins} does not contain the special * {@link #setAllowedOrigins allowedOrigins} does not contain the special
* value {@code "*"} since this is insecure. * value {@code "*"} since this is insecure.
* @throws IllegalArgumentException if the validation fails * @throws IllegalArgumentException if the validation fails
* @since 6.1.3 * @since 5.3.32
*/ */
public void validateAllowPrivateNetwork() { public void validateAllowPrivateNetwork() {
if (this.allowPrivateNetwork == Boolean.TRUE && if (this.allowPrivateNetwork == Boolean.TRUE &&

4
spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 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.
@ -135,7 +135,7 @@ public class CorsRegistration {
* Whether private network access is supported. * Whether private network access is supported.
* <p>Please, see {@link CorsConfiguration#setAllowPrivateNetwork(Boolean)} for details. * <p>Please, see {@link CorsConfiguration#setAllowPrivateNetwork(Boolean)} for details.
* <p>By default this is not set (i.e. private network access is not supported). * <p>By default this is not set (i.e. private network access is not supported).
* @since 6.1.3 * @since 5.3.32
*/ */
public CorsRegistration allowPrivateNetwork(boolean allowPrivateNetwork) { public CorsRegistration allowPrivateNetwork(boolean allowPrivateNetwork) {
this.config.setAllowPrivateNetwork(allowPrivateNetwork); this.config.setAllowPrivateNetwork(allowPrivateNetwork);

4
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2023 the original author or authors. * Copyright 2002-2024 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.
@ -135,7 +135,7 @@ public class CorsRegistration {
/** /**
* Whether private network access is supported. * Whether private network access is supported.
* <p>By default this is not set (i.e. private network access is not supported). * <p>By default this is not set (i.e. private network access is not supported).
* @since 6.1.3 * @since 5.3.32
* @see <a href="https://wicg.github.io/private-network-access/">Private network access specifications</a> * @see <a href="https://wicg.github.io/private-network-access/">Private network access specifications</a>
*/ */
public CorsRegistration allowPrivateNetwork(boolean allowPrivateNetwork) { public CorsRegistration allowPrivateNetwork(boolean allowPrivateNetwork) {

Loading…
Cancel
Save