Fixes issue with https domains returning true for cross domain by correctly getting the port.