Skip to content

Commit

Permalink
Correct Discord avatar code and add warning.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Aterfax authored Aug 22, 2024
1 parent b301048 commit a9c5cbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/docs/sources/discord/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit a9c5cbd

Please sign in to comment.