Arjen10 opened a new issue, #13817:
URL: https://github.com/apache/apisix/issues/13817

   ### Current Behavior
   
   using data mask plugin remove an array element
   
   ### Expected Behavior
   
   _No response_
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   1、create router
   ```json
   {
       "uri": "/bizProject/test",
       "name": "bizProject-test",
       "plugins": {
           "data-mask": {
               "request": [
                   {
                       "action": "remove",
                       "body_format": "json",
                       "name": "$.items[1]",
                       "type": "body"
                   }
               ]
           },
           "file-logger": {
               "path": "logs/bizProject-test.log",
               "include_req_body": true,
               "include_resp_body": true
           }
       },
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "172.18.0.222:8080": 1
           }
       }
   }
   ```
   
   2、send request
   ```json
   {
       "items": [
           "a",
           "b",
           "c"
       ]
   }
   ```
   
   3、expected outcome
   
   ```json
   {
     "latency": 73.999881744385,
     "route_id": "test",
     "server": {
       "version": "3.17.0",
       "hostname": "a9f549220313"
     },
     "upstream": "172.18.0.222:8080",
     "client_ip": "172.18.0.222",
     "service_id": "",
     "request": {
       "headers": {},
       -- correct delete
       "body": "{\"items\":[\"a\",\"c\"]}",
       "size": 364,
       "url": "http://172.18.0.21:9080/bizProject/test";,
       "method": "POST",
       "uri": "/bizProject/test",
       "querystring": {}
     },
     "apisix_latency": 0.99988174438477,
     "upstream_latency": 73,
     "response": {
       "body": 
"{\"code\":200000,\"data\":{\"items\":[\"a\",\"b\",\"c\"]},\"message\":\"请求成功\",\"success\":true}",
       "headers": {},
       "status": 200,
       "size": 421
     },
     "start_time": 1786608352176
   }
   ```
   
   4、actual result
   
   ```json
   {
     "latency": 7.9998970031738,
     "upstream_latency": 8,
     "route_id": "test",
     "upstream": "172.18.0.222:8080",
     "apisix_latency": 0,
     "response": {
       "status": 200,
       "size": 421,
       "body": 
"{"code":200000,"data":{"items":["a","b","c"]},"message":"请求成功","success":true}",
       "headers": {}
     },
     "server": {
       "hostname": "a9f549220313",
       "version": "3.17.0"
     },
     "service_id": "",
     "start_time": 1786607610239,
     "client_ip": "172.18.0.222",
     "request": {
       -- truncated
       "body": "{"items":["a"]}",
       "url": "http://172.18.0.21:9080/bizProject/test";,
       "headers": {},
       "querystring": {},
       "size": 364,
       "uri": "/bizProject/test",
       "method": "POST"
     }
   }
   ```
   
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.17.0


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