We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在配置路由的路径、请求头、请求参数时,有需要表达“非”关系的场景。例如:现有一个路由/animal,在配置请求头时,希望只要符合 animal≠cat 时都导去 dog 的页面。
目前在 Higress Console 上,对于路径、请求头和请求参数的匹配条件都支持正则匹配:
所以尝试过使用 负向前瞻断言 来表达非的关系,如:
但是并没有成功
咨询过 zty,他说目前还不支持这种正则语法,但是我们这边确实存在这样的需求。
之前我们也了解过 Traefik,它对路由策略的与或非是这样解决的:
The text was updated successfully, but these errors were encountered:
这个可能短期不会支持,一方面 Ingress API/Gateway API 都没有对与非匹配这种路由条件的定义; 另一方面,在主流的 CPP 正则库如 RE2,以及 HyperScan 中都没有对 zero width asserts 的支持。
Sorry, something went wrong.
No branches or pull requests
使用场景
在配置路由的路径、请求头、请求参数时,有需要表达“非”关系的场景。例如:现有一个路由/animal,在配置请求头时,希望只要符合 animal≠cat 时都导去 dog 的页面。
已尝试的方法
目前在 Higress Console 上,对于路径、请求头和请求参数的匹配条件都支持正则匹配:
所以尝试过使用 负向前瞻断言 来表达非的关系,如:
但是并没有成功
咨询过 zty,他说目前还不支持这种正则语法,但是我们这边确实存在这样的需求。
附上 Traefik 的做法
之前我们也了解过 Traefik,它对路由策略的与或非是这样解决的:
The text was updated successfully, but these errors were encountered: