You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "soulbird (via GitHub)" <gi...@apache.org> on 2023/04/28 01:19:26 UTC
[GitHub] [apisix] soulbird commented on a diff in pull request #9372: fix: response-rewrite plugin can't add only one character
soulbird commented on code in PR #9372:
URL: https://github.com/apache/apisix/pull/9372#discussion_r1179845121
##########
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:
Do you need to verify whether the header is valid?
--
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