Aias00 commented on code in PR #7755:
URL: https://github.com/apache/shenyu/pull/7755#discussion_r4303401447


##########
shenyu-plugin/shenyu-plugin-param-mapping/src/main/java/org/apache/shenyu/plugin/param/mapping/strategy/FormDataOperator.java:
##########
@@ -64,7 +64,8 @@ public Mono<Void> apply(final ServerWebExchange exchange, 
final ShenyuPluginChai
         return exchange.getFormData()
                 .switchIfEmpty(Mono.just(new LinkedMultiValueMap<>()))
                 .flatMap(multiValueMap -> {
-                    if (Objects.isNull(multiValueMap) || 
multiValueMap.isEmpty()) {
+                    if (Objects.isNull(multiValueMap)
+                            || (multiValueMap.isEmpty() && 
CollectionUtils.isEmpty(paramMappingRuleHandle.getAddParameterKeys()))) {

Review Comment:
   Non-blocking: this condition now encodes the knowledge that 
`addParameterKeys` is the only mutation that can materialise a body from 
nothing. If the handle ever gains another body-producing mutation, the guard 
silently reverts to the old behaviour — a `hasBodyMutations()` helper (or a 
comment pointing at the coupling) would keep that decision in one place.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to