Firstsawyou opened a new issue #2511:
URL: https://github.com/apache/apisix/issues/2511
### Issue description
We can add new features to the fault-injection plugin for the following
reasons:
Currently, the `fault-injection` plugin does not support custom conditions
to implement the `mock` function. I think we can add the request header as a
conditional judgment in the request (there may be a better way) to realize the
mock function.
E.g:
```
"vars": [
[ "httP_mock01", "==", " api01" ],
[ "httP_mock02", "==", " api02" ]
]
```
When there are multiple conditions in `vars`, they have an `or` relationship.
If `vars` passes the verification, fault injection is performed on the
request. Otherwise, no processing is done on the request. In order to maintain
backward compatibility, the fault injection operation is still performed when
the vars condition is not configured.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]