Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: tzssangglass <tzssangglass@gmail.com>
Co-authored-by: Alex Zhang <tokers@apache.org>
  • Loading branch information
3 people committed May 18, 2022
1 parent 155b5b3 commit 6b38bfe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions apisix/plugins/redirect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ function _M.rewrite(conf, ctx)

if not ret_port then
local local_conf = core.config.local_conf()
local ssl = core.table.try_read_attr(local_conf,
"apisix",
"ssl")
local ssl = core.table.try_read_attr(local_conf, "apisix", "ssl")
if ssl and ssl["enable"] then
ret_port = ssl["listen_port"]
if not ret_port then
Expand Down
2 changes: 1 addition & 1 deletion docs/en/latest/plugins/redirect.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Only one of `http_to_https`, `uri` and `regex_uri` can be configured.

* When enabling `http_to_https`, the ports in the redirect URL will pick a value in the following order (in descending order of priority)
* Read `plugin_attr.redirect_https_port` from the configuration file (`conf/config.yaml`).
* If `apisix.ssl` is enabling, read `apisix.ssl.listen_port` first, and if it does not exist, read `apisix.ssl.listen` and select a random port from it.
* If `apisix.ssl` is enabled, read `apisix.ssl.listen_port` first, and if it does not exist, read `apisix.ssl.listen` and select a port randomly from it.
* Use 443 as the default https port.

:::
Expand Down

0 comments on commit 6b38bfe

Please sign in to comment.