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/02/11 16:03:48 UTC

[GitHub] [apisix] soham4abc commented on a change in pull request #6242: fix(redirect-plugin): redirection loop behind a proxy or lb

soham4abc commented on a change in pull request #6242:
URL: https://github.com/apache/apisix/pull/6242#discussion_r804790452



##########
File path: t/plugin/redirect.t
##########
@@ -1000,3 +1000,58 @@ Location: /hello?type=string&name=json
 --- error_code: 302
 --- no_error_log
 [error]
+
+
+
+=== TEST 41: enable http_to_https (pass X-Forwarded-Proto)
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                ngx.HTTP_PUT,
+                [[{
+                    "uri": "/hello",
+                    "host": "foo.com",
+                    "vars": [
+                        [
+                            "scheme",
+                            "==",
+                            "http"
+                        ]
+                    ],
+                    "plugins": {
+                        "redirect": {
+                            "http_to_https": true
+                        }
+                    }
+                }]]
+                )
+
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(body)
+        }
+    }
+

Review comment:
       @spacewander  Won't removing the extra lines make lint errors??




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