webbukkit/DynmapCore

When using a reverse web proxy in front of Dynmap, canonical IPv6 format mismatch prevents user matching for web chat.

mooinglemur opened this issue · 0 comments

For example, Apache will forward my IPv6 address using the X-Forwarded-For header. From an IPv6 address, it would encode it in a form such as 2001:db8::1234, but Java's canonical representation of that same address would be 2001:db8:0:0:0:0:0:1234, and Minecraft/Dynmap can't match the logged-in user to the web user, even from the same IPv6 address.

This only happens when an IPv6 quad contains a zero, and Dynmap is trusting X-Forwarded-For (via the trusted-proxies setting in dynmap).

Perhaps the address(es) extracted from X-Forwarded-For could be Java-canoncialized before being stuffed into message.name so that the next block which checks the IP against logins will find matches.