Skip to content

feat(response-rewrite): support adding header#7794

Merged
spacewander merged 3 commits into
apache:masterfrom
spacewander:rwr
Aug 30, 2022
Merged

feat(response-rewrite): support adding header#7794
spacewander merged 3 commits into
apache:masterfrom
spacewander:rwr

Conversation

@spacewander

Copy link
Copy Markdown
Member

See https://lists.apache.org/thread/bxl0sn1qb5fchvnynz7b8sst9r07cyqm
Signed-off-by: spacewander [email protected]

Description

Fixes #7776

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@spacewander
spacewander marked this pull request as ready for review August 25, 2022 11:43
Comment thread apisix/plugins/response-rewrite.lua Outdated
Comment thread apisix/plugins/response-rewrite.lua Outdated
| headers.add | array | 否 | | | 添加新的响应头。格式为 `["name: value", ...]`。这个值能够以 `$var` 的格式包含 NGINX 变量,比如 `$remote_addr $balancer_ip`。 |
| headers.set | object | 否 | | | 改写响应头。格式为 `{"name": "value", ...}`。这个值能够以 `$var` 的格式包含 NGINX 变量,比如 `$remote_addr $balancer_ip`。 |
| headers.remove | array | 否 | | | 移除响应头。格式为 `["name", ...]`。 |
| headers | object | 否 | | | 返回给客户端的 `headers`,这里可以设置多个。头信息如果存在将重写,不存在则添加。想要删除某个 header 的话,把对应的值设置为空字符串即可。 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repeated?

Signed-off-by: spacewander <[email protected]>
Comment thread t/plugin/response-rewrite2.t
Signed-off-by: spacewander <[email protected]>
Comment thread apisix/plugins/response-rewrite.lua
@spacewander
spacewander requested a review from tokers August 29, 2022 03:29
@spacewander
spacewander merged commit 7a24ea6 into apache:master Aug 30, 2022
@spacewander
spacewander deleted the rwr branch August 30, 2022 06:32
Liu-Junlin pushed a commit to Liu-Junlin/apisix that referenced this pull request Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Reposne_write plugin will delete the server-side cookies

4 participants