kingluo commented on code in PR #9534:
URL: https://github.com/apache/apisix/pull/9534#discussion_r1205305949


##########
apisix/init.lua:
##########
@@ -640,6 +641,14 @@ function _M.http_access_phase()
             enable_websocket = service.value.enable_websocket
         end
 
+        if route.value.strip_path_prefix and service.value.path_prefix then
+            local uri = api_ctx.var.uri
+            if uri:find(service.value.path_prefix) == 1 then

Review Comment:
   lua built-in string.find is more simple and high efficient 
(core.string.has_prefix uses ffi to call memcmp).



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