monkeyDluffy6017 commented on code in PR #8824:
URL: https://github.com/apache/apisix/pull/8824#discussion_r1118240827


##########
t/core/request.t:
##########
@@ -439,3 +439,47 @@ while ($i <= 101) {
 $s
 --- response_body
 101
+
+
+
+=== TEST 15: add header
+--- config
+    location /t {
+        content_by_lua_block {
+            local core = require("apisix.core")
+            ngx.ctx.api_ctx = {}
+            local ctx = ngx.ctx.api_ctx
+            core.request.add_header(ctx, "test_header", "test")
+            local h = core.request.header(ctx, "test_header")
+            ngx.say(h)
+            core.request.add_header(ctx, "test_header", "t2")
+            local h2 = core.request.header(ctx, "test_header")
+            ngx.say("[" .. table.concat(h2, ", ") .. "]")

Review Comment:
   is it better to use `core.json.encode` instead?



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