fix a minor bug for safePorts in intranet env.