I have some handling for X-Forwarded-For, but none of the others. This could actually explain why I was still seeing rate limit errors despite not having made many requests from my IP address.
I'm unfortunately busy this week, but I hope I can still find some time in the next few days to implement this.
headers.set("x-forwarded-proto", request.headers.get("x-forwarded-proto") ?? "https");
Shouldn't that fallback be http, since mlmym doesn't do HTTPS itself? And I assume the reverse proxy will have set X-Forwarded-Proto to https.