Same-domain checking with relative protocols

The domain check checks hostname, then protocol, if it exists.
Merge pull request #43 from Aintaer/master

Same-domain checking with relative protocols