You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "mark4z (via GitHub)" <gi...@apache.org> on 2023/06/11 06:25:50 UTC

[GitHub] [dubbo-go-pixiu] mark4z commented on a diff in pull request #565: feat: add support for header based route

mark4z commented on code in PR #565:
URL: https://github.com/apache/dubbo-go-pixiu/pull/565#discussion_r1225720827


##########
pixiu/pkg/common/router/router.go:
##########
@@ -83,6 +114,21 @@ func (rm *RouterCoordinator) initTrie() {
 	}
 }
 
+func (rm *RouterCoordinator) initRegex() {
+	for _, router := range rm.activeConfig.Routes {
+		headers := router.Match.Headers
+		for i := range headers {
+			if headers[i].Regex && len(headers[i].Values) > 0 {
+				// regexp always use first value of header
+				err := headers[i].SetValueRegex(headers[i].Values[0])
+				if err != nil {
+					logger.Errorf("invalid regexp in headers[%d]: %v", i, err)

Review Comment:
   Shouldn't it be panic here?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org