mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 20:57:32 +08:00
fix: routing priorities are not working properly (#472)
Signed-off-by: charlie <qianglin98@qq.com>
This commit is contained in:
@@ -170,7 +170,14 @@ func SortHTTPRoutes(routes []*WrapperHTTPRoute) {
|
||||
|
||||
isAllCatch := func(route *WrapperHTTPRoute) bool {
|
||||
if route.OriginPathType == Prefix && route.OriginPath == "/" {
|
||||
return true
|
||||
if route.HTTPRoute.Match == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
match := route.HTTPRoute.Match[0]
|
||||
if len(match.Headers) == 0 && len(match.QueryParams) == 0 && match.Method == nil {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -599,11 +599,6 @@ func (c *controller) ConvertHTTPRoute(convertOptions *common.ConvertOptions, wra
|
||||
} else {
|
||||
convertOptions.HTTPRoutes[rule.Host] = wrapperHttpRoutes
|
||||
}
|
||||
|
||||
// Sort, exact -> prefix -> regex
|
||||
routes := convertOptions.HTTPRoutes[rule.Host]
|
||||
IngressLog.Debugf("routes of host %s is %v", rule.Host, routes)
|
||||
common.SortHTTPRoutes(routes)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user