You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "LiteSun (via GitHub)" <gi...@apache.org> on 2023/05/05 01:27:52 UTC

[GitHub] [apisix] LiteSun commented on a diff in pull request #9372: fix: response-rewrite plugin can't add only one character

LiteSun commented on code in PR #9372:
URL: https://github.com/apache/apisix/pull/9372#discussion_r1185637997


##########
t/plugin/response-rewrite.t:
##########
@@ -696,3 +696,40 @@ passed
 --- request
 GET /hello
 --- response_body
+
+
+
+=== TEST 27: test add header with one word
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                 ngx.HTTP_PUT,
+                 [[{
+                    "plugins": {
+                        "response-rewrite": {
+                            "headers": {
+                                "add": [
+                                    "X-Server-test:a"
+                                ]
+                            }
+                        }
+                    },
+                    "upstream": {
+                        "nodes": {
+                            "127.0.0.1:1980": 1
+                        },
+                        "type": "roundrobin"
+                    },
+                    "uris": ["/hello"]
+                }]]
+                )
+
+            ngx.say(body)
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed

Review Comment:
   @soulbird Hi, this PR only fixes the issue of not being able to configure a single character and adds test coverage, which header can be verified to have been covered by the previous tests, not what this PR needs to do. 🤔



-- 
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: notifications-unsubscribe@apisix.apache.org

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