You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2023/02/01 01:30:44 UTC

[apisix] branch master updated: chore: use operator # instead of string.len (#8751)

This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e63f69cf chore: use operator # instead of string.len (#8751)
9e63f69cf is described below

commit 9e63f69cf66f67553ca5febba5aab51f6a29699f
Author: Ashing Zheng <ax...@gmail.com>
AuthorDate: Wed Feb 1 09:30:37 2023 +0800

    chore: use operator # instead of string.len (#8751)
---
 t/lib/server.lua      | 2 +-
 t/plugin/sls-logger.t | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/lib/server.lua b/t/lib/server.lua
index 603ca2ae6..542c6eaef 100644
--- a/t/lib/server.lua
+++ b/t/lib/server.lua
@@ -532,7 +532,7 @@ function _M.google_logging_entries()
         return
     end
 
-    token = string.sub(token, string.len(args_token_type) + 2)
+    token = string.sub(token, #args_token_type + 2)
     local verify = jwt:verify(rsa_public_key, token)
     if not verify.verified then
         ngx.status = 401
diff --git a/t/plugin/sls-logger.t b/t/plugin/sls-logger.t
index c1bce8107..fa3e9c43c 100644
--- a/t/plugin/sls-logger.t
+++ b/t/plugin/sls-logger.t
@@ -167,7 +167,7 @@ hello world
                 local first_idx = string.find(log_entry, " ") + 1
                 local last_idx2 = string.find(log_entry, " ", first_idx)
                 local rfc3339_date = string.sub(log_entry, first_idx, last_idx2)
-                local rfc3339_len = string.len(rfc3339_date)
+                local rfc3339_len = #rfc3339_date
                 local rfc3339_millisecond = string.sub(rfc3339_date, rfc3339_len - 4, rfc3339_len - 2)
                 return tonumber(rfc3339_millisecond)
             end