Skip to content

fix(analytics): check the x_forwarded_for client header

Aonrud requested to merge Aonrud/castopod:analytics_client_ip into develop

Check for the X_FORWARDED_FOR header when getting the client IP in the analytics module. This is used by some reverse proxies, e.g. Caddy.

Default to REMOTE_ADDR when X_FORWARDED_FOR is empty.

Fixes Analytics -> Locations report showing "Local IP" entries only.

Merge request reports