ignore http port when possible

Fix the problem when the method `getPort()` return `443` `80` or `null`.