You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/07/12 13:03:53 UTC
[GitHub] [apisix] spacewander commented on a diff in pull request #7433: fix: the query string is repeated twice when enable http-to-https and append-query-string (#7394)
spacewander commented on code in PR #7433:
URL: https://github.com/apache/apisix/pull/7433#discussion_r918943555
##########
apisix/plugins/redirect.lua:
##########
@@ -55,13 +55,32 @@ local schema = {
},
http_to_https = {type = "boolean"},
encode_uri = {type = "boolean", default = false},
- append_query_string = {type = "boolean", default = false},
+ append_query_string = {type = "boolean"},
+ },
+ allOf = {
+ {
+ oneOf = {
+ {required = {"uri"}},
+ {required = {"regex_uri"}},
+ {required = {"http_to_https"}},
+ },
+ },
+ -- append_query_string and http_to_https are exclusive
+ {
+ oneOf = {
+ {required = {"append_query_string"}},
+ {required = {"http_to_https"}},
+ {
+ ["not"] = {
+ anyOf = {
+ {required = {"append_query_string"}},
+ {required = {"http_to_https"}},
+ },
+ },
+ },
+ },
+ },
},
- oneOf = {
- {required = {"uri"}},
- {required = {"regex_uri"}},
- {required = {"http_to_https"}}
Review Comment:
https://github.com/apache/apisix/blob/ccfb00055c9814f3a94514e48aa583700ab94189/apisix/schema_def.lua#L420
We can use `not` operation to show the exclusive relationship?
--
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@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org