diff options
author | mscherer <mscherer@users.noreply.github.com> | 2021-12-21 23:53:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-21 22:53:03 +0000 |
commit | cb05d3a23a78b0c62eab45450a6179cd8e4ebd35 (patch) | |
tree | ce0e24d2a575f4972a94422b762d03ddaf80ae64 /services | |
parent | 7be82f4af8ce0a89f94116d2913bc25c6fc4d9b1 (diff) | |
download | gitea-cb05d3a23a78b0c62eab45450a6179cd8e4ebd35.tar.gz gitea-cb05d3a23a78b0c62eab45450a6179cd8e4ebd35.zip |
Add List-Unsubscribe header (#17804)
Fixes #13283
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/mailer/mail.go | 2 | ||||
-rw-r--r-- | services/mailer/mail_test.go | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/services/mailer/mail.go b/services/mailer/mail.go index 91d39abead..0a55737073 100644 --- a/services/mailer/mail.go +++ b/services/mailer/mail.go @@ -348,7 +348,7 @@ func generateAdditionalHeaders(ctx *mailCommentContext, reason string, recipient // https://datatracker.ietf.org/doc/html/rfc2369 "List-Archive": fmt.Sprintf("<%s>", repo.HTMLURL()), //"List-Post": https://github.com/go-gitea/gitea/pull/13585 - //"List-Unsubscribe": https://github.com/go-gitea/gitea/issues/10808, https://github.com/go-gitea/gitea/issues/13283 + "List-Unsubscribe": ctx.Issue.HTMLURL(), "X-Gitea-Reason": reason, "X-Gitea-Sender": ctx.Doer.DisplayName(), diff --git a/services/mailer/mail_test.go b/services/mailer/mail_test.go index 1ce1020d07..6a175337ad 100644 --- a/services/mailer/mail_test.go +++ b/services/mailer/mail_test.go @@ -218,6 +218,7 @@ func TestGenerateAdditionalHeaders(t *testing.T) { expected := map[string]string{ "List-ID": "user2/repo1 <repo1.user2.localhost>", "List-Archive": "<https://try.gitea.io/user2/repo1>", + "List-Unsubscribe": "https://try.gitea.io/user2/repo1/issues/1", "X-Gitea-Reason": "dummy-reason", "X-Gitea-Sender": "< U<se>r Tw<o > ><", "X-Gitea-Recipient": "Test", |