From a9c5cbd0378e6cd00819ac5bfaef921caaa73a40 Mon Sep 17 00:00:00 2001 From: Aterfax Date: Thu, 22 Aug 2024 22:28:08 +0100 Subject: [PATCH] Correct Discord avatar code and add warning. There's a mispelling which causes the avatar gathered to not be the desired size. Additionally, larger avatars appear to cause "Header too large" errors when users attempt to access services (at least for me via a proxy providers.) This can also be seen users have a very large JWT in their request headers. (You can use https://github.com/traefik/whoami for debugging). Signed-off-by: Aterfax --- website/docs/sources/discord/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/sources/discord/index.md b/website/docs/sources/discord/index.md index 9970a12da270..faf631021d36 100644 --- a/website/docs/sources/discord/index.md +++ b/website/docs/sources/discord/index.md @@ -327,10 +327,10 @@ Create a new **Expression Policy** with the content below, adjusting the variabl import base64 import requests -AVATAR_SIZE = "64" # Valid values: 16,32,64,128,256,512,1024 +AVATAR_SIZE = "64" # Valid values: 16,32,64,128,256,512,1024. Larger values may cause HTTP error 431 on applications/providers due to headers being too large. # Only change below here if you know what you are doing. -AVATAR_URL = "https://cdn.discordapp.com/avatars/{id}/{avatar}.png?site={avatar_size}" +AVATAR_URL = "https://cdn.discordapp.com/avatars/{id}/{avatar}.png?size={avatar_size}" AVATAR_STREAM_CONTENT = "data:image/png;base64,{base64_string}" # Converts base64 image into html syntax usable with authentik's avatar attributes feature