feat(trafiic-split): support rules based on json request body #11289
+222
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
After this change, the traffic-split will be able to support rules based on json body in POST request. For example:
If we create a route like this:
In traffic-split we defined "json_body_arg_cat.sounds_like" == "mewo", which means it will match the json body like this:
Motivation:
Currently the traffic-split plugin can create rules based on the default form of the POST request.
However it does not support rules based on application/json in the POST request body.
I think it will be great if it can support the rules based on json body as well.
As I have the need to have rules based on json body too.
Fixes # (issue)
Checklist