From bd4823e3debb7bc59e05ba2d6c344f3bead63a8b Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Mon, 1 Jul 2024 16:26:49 +0200 Subject: [PATCH] Remove deprecated methods scheduled for removal in 6.2 See gh-33123 --- .../http/codec/ResourceHttpMessageWriter.java | 11 --------- .../web/util/UriComponentsBuilder.java | 24 ++----------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/http/codec/ResourceHttpMessageWriter.java b/spring-web/src/main/java/org/springframework/http/codec/ResourceHttpMessageWriter.java index f1517acfda00..bbcc49b9be50 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/ResourceHttpMessageWriter.java +++ b/spring-web/src/main/java/org/springframework/http/codec/ResourceHttpMessageWriter.java @@ -135,17 +135,6 @@ private Mono writeResource(Resource resource, ResolvableType type, @Nullab })); } - /** - * Adds the default headers for the given resource to the given message. - * @since 6.0 - * @deprecated since 6.1, in favor of {@link #addDefaultHeaders(ReactiveHttpOutputMessage, Resource, MediaType, Map)}, - * for removal = 6.2 - */ - @Deprecated(since = "6.1", forRemoval = true) - public void addHeaders(ReactiveHttpOutputMessage message, Resource resource, @Nullable MediaType contentType, Map hints) { - addDefaultHeaders(message, resource, contentType, hints).block(); - } - /** * Adds the default headers for the given resource to the given message. * @since 6.1 diff --git a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java index 1a64481252dc..3b80c38f6a82 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java +++ b/spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java @@ -16,7 +16,6 @@ package org.springframework.web.util; -import java.net.InetSocketAddress; import java.net.URI; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -265,7 +264,8 @@ public static UriComponentsBuilder fromUriString(String uri) throws InvalidUrlEx * * @param httpUrl the source URI * @return the URI components of the URI - * @deprecated as of 6.2, in favor of {@link #fromUriString(String)} + * @deprecated as of 6.2, in favor of {@link #fromUriString(String)}; + * scheduled for removal in 8.0. */ @Deprecated(since = "6.2") public static UriComponentsBuilder fromHttpUrl(String httpUrl) throws InvalidUrlException { @@ -298,26 +298,6 @@ public static UriComponentsBuilder fromHttpRequest(HttpRequest request) { return ForwardedHeaderUtils.adaptFromForwardedHeaders(request.getURI(), request.getHeaders()); } - /** - * Parse the first "Forwarded: for=..." or "X-Forwarded-For" header value to - * an {@code InetSocketAddress} representing the address of the client. - * @param request a request with headers that may contain forwarded headers - * @param remoteAddress the current remoteAddress - * @return an {@code InetSocketAddress} with the extracted host and port, or - * {@code null} if the headers are not present. - * @since 5.3 - * @deprecated in favor of {@link ForwardedHeaderUtils#parseForwardedFor}; - * to be removed in 6.2 - */ - @Deprecated(since = "6.1", forRemoval = true) - @Nullable - public static InetSocketAddress parseForwardedFor( - HttpRequest request, @Nullable InetSocketAddress remoteAddress) { - - return ForwardedHeaderUtils.parseForwardedFor( - request.getURI(), request.getHeaders(), remoteAddress); - } - /** * Create an instance by parsing the "Origin" header of an HTTP request. * @see RFC 6454