same domain detection adjustment
Same-domain checking with relative protocols

The domain check checks hostname, then protocol, if it exists.