tokers commented on a change in pull request #2696:
URL: https://github.com/apache/apisix/pull/2696#discussion_r521024212



##########
File path: t/lib/server.lua
##########
@@ -101,8 +101,15 @@ function _M.uri()
     -- ngx.sleep(1)
     ngx.say("uri: ", ngx.var.uri)
     local headers = ngx.req.get_headers()
-    for k, v in pairs(headers) do
-        ngx.say(k, ": ", v)
+
+    local keys = {}
+    for k, _ in pairs(headers) do
+        table.insert(keys, k)
+    end
+    table.sort(keys)
+
+    for _, key in pairs(keys) do

Review comment:
       Use `ipairs` here since `keys` is an array-like table.




----------------------------------------------------------------
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:
[email protected]


Reply via email to