diff options
author | K. Adam White <kadamwhite@git.wordpress.org> | 2018-08-11 18:50:23 +0000 |
---|---|---|
committer | K. Adam White <kadamwhite@git.wordpress.org> | 2018-08-11 18:50:23 +0000 |
commit | 245fb8e9b08d321220e158e836aa02fa4e275971 (patch) | |
tree | 749fc79f85e692a1cc7919fb8bb6da9bd618e7be /src/js/_enqueues/wp/api.js | |
parent | 244f435e226864fb85ec599a8753e4e8eb7bab9c (diff) | |
download | wordpress-245fb8e9b08d321220e158e836aa02fa4e275971.tar.gz wordpress-245fb8e9b08d321220e158e836aa02fa4e275971.zip |
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
Diffstat (limited to 'src/js/_enqueues/wp/api.js')
-rw-r--r-- | src/js/_enqueues/wp/api.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/_enqueues/wp/api.js b/src/js/_enqueues/wp/api.js index c62e73ff38..e5aeac6e4c 100644 --- a/src/js/_enqueues/wp/api.js +++ b/src/js/_enqueues/wp/api.js @@ -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 + '/'; }; /** |