-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: the query string is repeated twice when enable http-to-https and append-query-string (#7394) #7433
fix: the query string is repeated twice when enable http-to-https and append-query-string (#7394) #7433
Conversation
… append-query-string (apache#7394)
docs/en/latest/plugins/redirect.md
Outdated
@@ -34,7 +34,7 @@ The `redirect` Plugin can be used to configure redirects. | |||
|
|||
| Name | Type | Required | Default | Valid values | Description | | |||
|---------------------|---------------|----------|---------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | |||
| http_to_https | boolean | False | false | | When set to `true` and the request is HTTP, it will be redirected to HTTPS with the same URI with a 301 status code. | | |||
| http_to_https | boolean | False | false | | When set to `true` and the request is HTTP, it will be redirected to HTTPS with the same URI with a 301 status code, contains the query string. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| http_to_https | boolean | False | false | | When set to `true` and the request is HTTP, it will be redirected to HTTPS with the same URI with a 301 status code, contains the query string. | | |
| http_to_https | boolean | False | false | | When set to `true` and the request is HTTP, it will be redirected to HTTPS with the same URI with a 301 status code. Note the querystring from the raw URI will also be contained in the Location header. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/en/latest/plugins/redirect.md
Outdated
Only one of `http_to_https`, `uri` and `regex_uri` can be configured. | ||
Only one of `http_to_https` and `append_query_string` can be configured. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one of `http_to_https`, `uri` and `regex_uri` can be configured. | |
Only one of `http_to_https` and `append_query_string` can be configured. | |
* Only one of `http_to_https`, `uri` and `regex_uri` can be configured. | |
* Only one of `http_to_https` and `append_query_string` can be configured. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
t/plugin/redirect.t
Outdated
--- no_error_log | ||
[error] | ||
|
||
|
||
|
||
=== TEST 26: enable http_to_https with upstream | ||
=== TEST 26: wrong configure, enable http_to_https with append_query_string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change the test case position to the end of the file (so there won't' have many test number changes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
oneOf = { | ||
{required = {"uri"}}, | ||
{required = {"regex_uri"}}, | ||
{required = {"http_to_https"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 420 in ccfb000
["not"] = {required = {"client_cert_id"}} |
We can use
not
operation to show the exclusive relationship?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried, but not succeed
["not"] = {
allOf = {
{required = {"append_query_string"}},
{required = {"http_to_https"}},
}
}
and
["not"] = {required = {"append_query_string", "http_to_https"}},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http_to_https = {
["not"] = {required = {"uri", "regex_uri", "append_query_string"}}
},
uri = {
["not"] = {required = {"regex_uri", "http_to_https"}}
},
regex_uri = {
["not"] = {required = {"uri", "http_to_https"}}
},
what about this form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give it a try:
oneOf = {
{required = {"uri"}},
{required = {"regex_uri"}},
{required = {"http_to_https"}, ["not"] = {
required = {"append_query_string"}
}}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give it a try:
oneOf = { {required = {"uri"}}, {required = {"regex_uri"}}, {required = {"http_to_https"}, ["not"] = { required = {"append_query_string"} }} }
It does work, i have updated, please check @spacewander
… append-query-string (apache#7394) (apache#7433)
Description
Fix bug that the query string is repeated twice when enable http-to-https and append-query-string
Fixes #7394
Checklist