Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Aug 30, 2022

Conversation

spacewander
Copy link
Member

See https://lists.apache.org/thread/bxl0sn1qb5fchvnynz7b8sst9r07cyqm
Signed-off-by: spacewander spacewanderlzx@gmail.com

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
apisix/plugins/response-rewrite.lua Outdated Show resolved Hide resolved
apisix/plugins/response-rewrite.lua Outdated Show resolved Hide resolved
| 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
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 <spacewanderlzx@gmail.com>
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
@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