monkeyDluffy6017 commented on code in PR #9669:
URL: https://github.com/apache/apisix/pull/9669#discussion_r1233894569


##########
apisix/plugins/body-transformer.lua:
##########
@@ -123,6 +128,8 @@ local function transform(conf, body, typ, ctx)
                 core.log.error(err, ", body=", body)
                 return nil, 400, err
             end
+        else
+            core.log.warn("no input format to parse ", typ, " body")

Review Comment:
   The `conf[typ].input_format` is set by `set_input_format`, so if there is no 
`content_type` and `input_format`, the `conf[typ].input_format` will be nil, if 
the `format` is nil, the `out` will get wrong.
   When i remove the parameter `input_format` of test 12 which you just added, 
i get this error:
   
![image](https://github.com/apache/apisix/assets/9354193/1e106a84-04ff-4074-bd14-b6ef6abc87f7)
   I think it's better to handle this case,  we need one of the `content_type` 
and `input_format`
   



-- 
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