Use hostname and port instead of host when comparing origins - Fix #347