[removed] picks IP address and not the domain name

2019-08-28 23:36发布

问题:

I've my ruby on rails website registered as a subdomain under godaddy.com

It works fine. But when I try to get the window.location.host, It returns the IP address of my server and not the domain name.

Because of this I'm getting the following error with my google picker js api:

    Incorrect origin value. Please set it to - (window.location.protocol + '//' + window.location.host) of the top-most page

Can anyone help ?

回答1:

This is because the domain might be set in domain forwarding mode. The domain needs to actually point to the IP which is different than domain forwarding.