Hamuko / anifunnel

Update your Anilist watching list automatically using Plex webhooks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

server returned 413 payload too large

PoiScript opened this issue · comments

hi, I tried to setup anifunnel in my home server but server only returned 413 errors when received request:

image

Never ran into this issue myself. Guessing that for some reason your Plex instance is returning webhook payloads that are >8KiB, which is the default size limit for strings in the web framework.

As a workaround, you could test increasing the data limit with an environment variable. For example ROCKET_LIMITS="{string=131072}" to set the maximum string size to 128KiB.

plex includes the thumbnail image in form data for some reason, which is causing the issue:

image

setting ROCKET_LIMITS="{string=131072}" fixes the problem, thanks!

Oh yeah, that seems to be a thing that Plex might do with its webhooks.

As stated above, the payload is sent in JSON format inside a multipart HTTP POST request. For the media.play and media.rate events, a second part of the POST request contains a JPEG thumbnail for the media.

I think I need to adjust the default limits to get rid of this issue, since even if this doesn't apply to anifunnel's events (only media.scrobble are ever processed and it's unlikely they'd add a thumbnail to that), it's still confusing to see this in the logs.