Firstsawyou opened a new pull request #3363:
URL: https://github.com/apache/apisix/pull/3363


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   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" ]
   ]
   ```
   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.
   
   close #2511
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features 
have been added?
   * [ ] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, 
please discuss on the [mailing 
list](https://github.com/apache/apisix/tree/master#community) first**
   


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to