Exclude Part from nested constructor binding in WebFlux
See gh-31778
This commit is contained in:
committed by
rstoyanchev
parent
c75c0ae2d5
commit
4d838c1092
@@ -20,6 +20,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
@@ -87,6 +89,13 @@ public class WebExchangeDataBinder extends WebDataBinder {
|
||||
.then();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldConstructArgument(MethodParameter param) {
|
||||
Class<?> type = param.nestedIfOptional().getNestedParameterType();
|
||||
return (super.shouldConstructArgument(param) &&
|
||||
!MultipartFile.class.isAssignableFrom(type) && !Part.class.isAssignableFrom(type));
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind query parameters, form data, or multipart form data to the binder target.
|
||||
* @param exchange the current exchange
|
||||
|
||||
Reference in New Issue
Block a user