Merge branch '6.2.x'

This commit is contained in:
Brian Clozel
2025-01-29 16:15:16 +01:00
8 changed files with 35 additions and 31 deletions

View File

@@ -17,6 +17,7 @@
package org.springframework.web.reactive.result.method.annotation;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.function.Predicate;
@@ -43,11 +44,11 @@ import org.springframework.web.server.ServerWebExchange;
*/
public class ExtendedWebExchangeDataBinder extends WebExchangeDataBinder {
private static final Set<String> FILTERED_HEADER_NAMES = Set.of("Accept", "Authorization", "Connection",
"Cookie", "From", "Host", "Origin", "Priority", "Range", "Referer", "Upgrade");
private static final Set<String> FILTERED_HEADER_NAMES = Set.of("accept", "authorization", "connection",
"cookie", "from", "host", "origin", "priority", "range", "referer", "upgrade");
private Predicate<String> headerPredicate = name -> !FILTERED_HEADER_NAMES.contains(name);
private Predicate<String> headerPredicate = name -> !FILTERED_HEADER_NAMES.contains(name.toLowerCase(Locale.ROOT));
public ExtendedWebExchangeDataBinder(@Nullable Object target, String objectName) {

View File

@@ -224,7 +224,7 @@ class InitBinderBindingContextTests {
@ParameterizedTest
@ValueSource(strings = {"Accept", "Authorization", "Connection",
"Cookie", "From", "Host", "Origin", "Priority", "Range", "Referer", "Upgrade"})
"Cookie", "From", "Host", "Origin", "Priority", "Range", "Referer", "Upgrade", "priority"})
void filteredHeaders(String headerName) throws Exception {
MockServerHttpRequest request = MockServerHttpRequest.get("/path")
.header(headerName, "u1")

View File

@@ -28,8 +28,6 @@ import java.util.Map;
import freemarker.template.Configuration;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
@@ -125,12 +123,6 @@ class FreeMarkerMacroTests {
}
@Test
@DisabledForJreRange(min = JRE.JAVA_21)
public void age() throws Exception {
testMacroOutput("AGE", "99");
}
@Test
void message() throws Exception {
testMacroOutput("MESSAGE", "Howdy Mundo");

View File

@@ -6,9 +6,6 @@ test template for FreeMarker macro support
NAME
${command.name}
AGE
${command.age}
MESSAGE
<@spring.message "hello"/> <@spring.message "world"/>