REST API: generate a valid fallback URI in wp.api.utils.getRootURL.

When window.location.origin isn't set, correctly insert two slashes between the protocol and host when constructing the fallback URL.

props abdullahramzan.
Fixes #44764.


git-svn-id: https://develop.svn.wordpress.org/trunk@43566 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
K. Adam White 2018-08-11 18:50:23 +00:00
parent 244f435e22
commit 245fb8e9b0

View File

@ -145,7 +145,7 @@
wp.api.utils.getRootUrl = function() {
return window.location.origin ?
window.location.origin + '/' :
window.location.protocol + '/' + window.location.host + '/';
window.location.protocol + '//' + window.location.host + '/';
};
/**