client: set referers properly

This commit is contained in:
Tulir Asokan
2024-11-29 19:25:43 +02:00
parent 8219516ede
commit b330c5836e
9 changed files with 48 additions and 20 deletions

View File

@@ -73,6 +73,12 @@ func uploadDiscordAttachment(url string, data []byte) error {
for key, value := range discordgo.DroidFetchHeaders {
req.Header.Set(key, value)
}
req.Header.Set("Content-Type", "application/octet-stream")
req.Header.Set("Referer", "https://discord.com/")
req.Header.Del("X-Debug-Options")
req.Header.Del("X-Discord-Locale")
req.Header.Del("X-Discord-Timezone")
req.Header.Del("X-Super-Properties")
resp, err := http.DefaultClient.Do(req)
if err != nil {