Skip to content

Commit cb05d3a

Browse files
mschererzeripathlunny
authored
Add List-Unsubscribe header (#17804)
Fixes #13283 Co-authored-by: zeripath <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
1 parent 7be82f4 commit cb05d3a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

services/mailer/mail.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func generateAdditionalHeaders(ctx *mailCommentContext, reason string, recipient
348348
// https://datatracker.ietf.org/doc/html/rfc2369
349349
"List-Archive": fmt.Sprintf("<%s>", repo.HTMLURL()),
350350
//"List-Post": https://github.com/go-gitea/gitea/pull/13585
351-
//"List-Unsubscribe": https://github.com/go-gitea/gitea/issues/10808, https://github.com/go-gitea/gitea/issues/13283
351+
"List-Unsubscribe": ctx.Issue.HTMLURL(),
352352

353353
"X-Gitea-Reason": reason,
354354
"X-Gitea-Sender": ctx.Doer.DisplayName(),

services/mailer/mail_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ func TestGenerateAdditionalHeaders(t *testing.T) {
218218
expected := map[string]string{
219219
"List-ID": "user2/repo1 <repo1.user2.localhost>",
220220
"List-Archive": "<https://try.gitea.io/user2/repo1>",
221+
"List-Unsubscribe": "https://try.gitea.io/user2/repo1/issues/1",
221222
"X-Gitea-Reason": "dummy-reason",
222223
"X-Gitea-Sender": "< U<se>r Tw<o > ><",
223224
"X-Gitea-Recipient": "Test",

0 commit comments

Comments
 (0)