Replies: 1 comment 2 replies
-
You should have an operator after |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I got error while I config traffic-split using admin-api.
Seems admin-api can not resolve "!" correctly in my reqeust.
{
"error_msg": "failed to check the configuration of plugin traffic-split err: failed to validate the 'vars' expression: invalid operator '!'"
}
Here is my postman setting:
URL:http://127.0.0.1:9080/apisix/admin/routes/395163938729231314
Body:
{
"id": "395163938729231314",
"name": "traffic-split-test",
"methods": [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"CONNECT",
"TRACE"
],
"plugins": {
"proxy-rewrite": {
"host": "proxy.test.com"
},
"traffic-split": {
"disable": false,
"rules": [
{
"match": [
{
"vars": [
[
"cookie_user_id",
"!",
"1"
]
]
}
],
"weighted_upstreams": [
{
"upstream_id": "368682855116571384",
"weight": 10
}
]
}
]
}
},
"uri": "/*",
"hosts": [
"demo.test.com"
],
"vars": [
[
"http_sssss",
"IN",
[
"asdfadsf"
]
],
[
"http_X-APP-ID",
"IN",
[
"872cc0ff763db3950176427d11fa0222",
"I872cc172771dafae017729e71f3b0059",
"872cc172765bf5090176607739b00024",
"2798807be64a46a8aa3f8883e48e27b4",
"40ef0ca977344fec9b168b17ea242bd6",
"6a470ab1696c4390b8863542c93ee723",
"37135e7b41594fdba3057dcf63971b3f",
"7f6b62ead3b0428da94efb379cccdf82",
"2bac6bdbda1c494b95d4cbf26def50cd"
]
]
],
"status": 1,
"upstream_id": "368682855116571384"
}
Result:
{
"error_msg": "failed to check the configuration of plugin traffic-split err: failed to validate the 'vars' expression: invalid operator '!'"
}
Would you please help to check if sonething wrong in my request?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions