summaryrefslogtreecommitdiffstats
path: root/services/webhook/discord.go
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2023-01-10 13:01:52 -0600
committerGitHub <noreply@github.com>2023-01-10 14:01:52 -0500
commite7f1d45eb5b20e782303fb7ce75e8c9877618b17 (patch)
tree1c545d9bae13c277760aa1ce726fe5df55207362 /services/webhook/discord.go
parent3b804ff76cdafa2ba9fce559269116aeb25a84c8 (diff)
downloadgitea-e7f1d45eb5b20e782303fb7ce75e8c9877618b17.tar.gz
gitea-e7f1d45eb5b20e782303fb7ce75e8c9877618b17.zip
fix: omit avatar_url in discord payload when empty (#22393)
Fixes #22391 This field is optional for Discord, however when it exists in the payload it is now validated. Omitting it entirely just makes Discord use the default for that webhook, which is set on the Discord side. Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'services/webhook/discord.go')
-rw-r--r--services/webhook/discord.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/webhook/discord.go b/services/webhook/discord.go
index ed44fef404..014d409ce7 100644
--- a/services/webhook/discord.go
+++ b/services/webhook/discord.go
@@ -55,7 +55,7 @@ type (
Wait bool `json:"wait"`
Content string `json:"content"`
Username string `json:"username"`
- AvatarURL string `json:"avatar_url"`
+ AvatarURL string `json:"avatar_url,omitempty"`
TTS bool `json:"tts"`
Embeds []DiscordEmbed `json:"embeds"`
}