fixes #3659 - use URL host for hostname, not URL itself