monkeyDluffy6017 commented on code in PR #9311:
URL: https://github.com/apache/apisix/pull/9311#discussion_r1184696241
##########
apisix/plugins/redirect.lua:
##########
@@ -75,6 +75,31 @@ local _M = {
}
+function _M.check_schema(conf)
+ local ok, err = core.schema.check(schema, conf)
+
+ if not ok then
+ return false, err
+ end
+
+ if conf.regex_uri and #conf.regex_uri > 0 then
+ local _, _, err = re_sub("/fake_uri", conf.regex_uri[1],
+ conf.regex_uri[2], "jo")
+ if err then
+ local msg = string_format("invalid regex_uri (%s, %s), err:%s",
+ conf.regex_uri[1], conf.regex_uri[2], err)
+ return false, msg
+ end
+ end
+
+ if conf.http_to_https and conf.append_query_string then
+ return false, "only one of `http_to_https` and `append_query_string`
can be configured."
+ end
+
+ return true
+end
+
+
Review Comment:
I suggest not moving this function in this pr, it doesn't match the pr title
--
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]