spacewander commented on a change in pull request #3396:
URL: https://github.com/apache/apisix/pull/3396#discussion_r562699131



##########
File path: apisix/init.lua
##########
@@ -324,6 +324,28 @@ function _M.http_access_phase()
 
     core.ctx.set_vars_meta(api_ctx)
 
+    local uri = api_ctx.var.uri
+    if local_conf.apisix and local_conf.apisix.delete_uri_tail_slash then
+        if str_byte(uri, #uri) == str_byte("/") then
+            api_ctx.var.uri = str_sub(api_ctx.var.uri, 1, #uri - 1)
+            core.log.info("remove the end of uri '/', current uri: ",
+                          api_ctx.var.uri)
+        end
+    end
+
+    if router.api.has_route_not_under_apisix() or

Review comment:
       Better to provide a switch to execute the global rule before matching 
internal API or don't execute the global rule. It is not skipped the internal 
API matched.
   
   > And I think if need to configure the plugin for the internal api, it is 
more appropriate to configure a route and then configure the plugin instead of 
using the global rule.
   
   We can't configure a plugin for internal API, this is the real problem.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to