Skip to content

Commit

Permalink
Add List-Unsubscribe header (#17804)
Browse files Browse the repository at this point in the history
Fixes #13283

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
3 people authored Dec 21, 2021
1 parent 7be82f4 commit cb05d3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion services/mailer/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 1 addition & 0 deletions services/mailer/mail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cb05d3a

Please sign in to comment.