tzssangglass commented on code in PR #7401:
URL: https://github.com/apache/apisix/pull/7401#discussion_r916454365


##########
t/plugin/proxy-rewrite3.t:
##########
@@ -200,3 +200,103 @@ passed
 GET /hello
 --- error_log
 plugin_proxy_rewrite get method: POST
+
+
+
+=== TEST 8: set route(unsafe uri normalized at request)
+--- 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,
+                 [[{
+                        "methods": ["GET"],
+                        "plugins": {
+                            "proxy-rewrite": {
+                                "use_real_request_uri_unsafe": false

Review Comment:
   It looks like we don't need this test case("use_real_request_uri_unsafe": 
false) because it defaults to false and there are existing test cases that 
override the default behavior.



##########
apisix/plugins/proxy-rewrite.lua:
##########
@@ -161,7 +166,9 @@ function _M.rewrite(conf, ctx)
     end
 
     local upstream_uri = ctx.var.uri
-    if conf.uri ~= nil then
+    if conf.use_real_request_uri_unsafe then
+        upstream_uri = core.utils.resolve_var("$real_request_uri", ctx.var)

Review Comment:
   we can use `core.utils.resolve_var("real_request_uri", ctx.var)` here? no `$`



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