bosprimigenious commented on code in PR #1076:
URL: https://github.com/apache/dubbo-go-pixiu/pull/1076#discussion_r4527118052


##########
pkg/filter/http/proxyrewrite/rewrite.go:
##########
@@ -79,7 +79,8 @@ func (factory *FilterFactory) Apply() error {
        if len(factory.cfg.UriRegex) != 2 {
                return errors.Errorf("UriRegex len must == 2, %v", 
factory.cfg.UriRegex)
        }
-       return nil
+       _, err := regexp.Compile(factory.cfg.UriRegex[0])
+       return err

Review Comment:
   f940760 中的 `Apply()` 和直接构造回退路径都已改为 `errors.Wrapf(err, "invalid uri_regex 
%q", pattern)`,错误会带上表达式。`UriRegex[1]` 
仍只作为替换串使用;你建议补充的“第二项不是正则”代码注释当前还没加上,这一点仍待处理。



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to