From 245fb8e9b08d321220e158e836aa02fa4e275971 Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Sat, 11 Aug 2018 18:50:23 +0000 Subject: [PATCH] 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 --- src/js/_enqueues/wp/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 + '/'; }; /**