jwrookie commented on code in PR #7065:
URL: https://github.com/apache/apisix/pull/7065#discussion_r874800880


##########
t/plugin/redirect.t:
##########
@@ -428,66 +428,69 @@ passed
 
 
 
-=== TEST 18: redirect
+=== TEST 18: redirect(port using `plugin_attr.redirect_https_port`)
 --- request
 GET /hello
 --- more_headers
 Host: foo.com
 --- error_code: 301
 --- response_headers
-Location: https://foo.com:1984/hello
+Location: https://foo.com:8443/hello
 
 
 
-=== TEST 19: redirect(pass well-known port 443 to x-forwarded-port)
+=== TEST 19: redirect(port using `apisix.ssl.listen_port`)
+--- yaml_config
+apisix:
+    ssl:
+        enable: true
+        listen_port: 9445
+--- extra_yaml_config
+plugin_attr:
+    redirect_https_port: null
 --- request
 GET /hello
 --- more_headers
 Host: foo.com
-x-forwarded-port: 443
 --- error_code: 301
 --- response_headers
-Location: https://foo.com/hello
-
-
-
-=== TEST 20: redirect(pass negative number to x-forwarded-port)
---- request
-GET /hello
---- more_headers
-Host: foo.com
-x-forwarded-port: -443
---- error_code: 301
---- response_headers
-Location: https://foo.com/hello
+Location: https://foo.com:9445/hello
 
 
 
-=== TEST 21: redirect(pass number more than 65535 to x-forwarded-port)
+=== TEST 20: redirect(port using `apisix.ssl.listen`)
+--- extra_yaml_config
+plugin_attr:
+    redirect_https_port: null
 --- request
 GET /hello
 --- more_headers
 Host: foo.com
-x-forwarded-port: 65536
 --- error_code: 301
 --- response_headers
-Location: https://foo.com/hello
+Location: https://foo.com:9443/hello
 
 
 
-=== TEST 22: redirect(pass invalid non-number to x-forwarded-port)
+=== TEST 21: redirect(port using `https default port`)
+--- yaml_config
+apisix:
+    ssl:
+        enable: null

Review Comment:
   Done



-- 
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]

Reply via email to