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.

Built from https://develop.svn.wordpress.org/trunk@43566


git-svn-id: http://core.svn.wordpress.org/trunk@43395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
K. Adam White
2018-08-11 18:51:24 +00:00
parent c0cc6617f2
commit b5ec1e6d96
3 changed files with 3 additions and 3 deletions

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 + '/';
};
/**