Fix getPort() returning 80 instead of 443 when X-FORWARDED-PROTO is set to https